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
|
@@ -10,10 +10,13 @@ import { homedir } from 'os';
|
|
|
10
10
|
import { fileURLToPath } from 'url';
|
|
11
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
12
|
const __dirname = dirname(__filename);
|
|
13
|
-
import { getModel } from '@mariozechner/pi-ai';
|
|
13
|
+
import { getModel, completeSimple } from '@mariozechner/pi-ai';
|
|
14
14
|
import { Agent } from '@mariozechner/pi-agent-core';
|
|
15
15
|
import { WorkspaceManager } from '../core/workspace-manager.js';
|
|
16
|
+
import { findPersonRefForUser } from '../services/user-person-bridge.js';
|
|
16
17
|
import { createGraphTools } from './tools/graph-tools.js';
|
|
18
|
+
import { createFolderTools } from './tools/folder-tools.js';
|
|
19
|
+
import { createHistoryTools } from './tools/history-tools.js';
|
|
17
20
|
import { loadSkillIndex, buildSkillIndexPrompt, loadEagerSkills } from './skill-loader.js';
|
|
18
21
|
import { createLoadSkillTool } from './tools/load-skill.js';
|
|
19
22
|
import { loadCustomTools } from './tools/tool-loader.js';
|
|
@@ -23,10 +26,18 @@ import { createFsTools } from './tools/fs-tools.js';
|
|
|
23
26
|
import { createWebTools } from './tools/web-tools.js';
|
|
24
27
|
import { createOpsTools } from './tools/ops-tools.js';
|
|
25
28
|
import { createPermissionTools } from './tools/permission-tools.js';
|
|
26
|
-
import {
|
|
29
|
+
import { createCaptureTools } from './tools/capture-tools.js';
|
|
30
|
+
import { createArtifactTools, hashArtifactBody } from './tools/artifact-tools.js';
|
|
31
|
+
import { validateArtifactBundle } from '../core/artifact-bundle.js';
|
|
32
|
+
import { renderEntityTypesSection } from './prompts/entity-types-section.js';
|
|
33
|
+
import { ENTITY_SCHEMAS } from '../core/validation.js';
|
|
27
34
|
import { AuthService } from '../services/auth-service.js';
|
|
35
|
+
import * as access from '../services/access-control.js';
|
|
28
36
|
import { loadUserConfig, resolveApiKey, resolveProvider, resolveModelId } from '../core/user-config.js';
|
|
37
|
+
import { supportsVision } from '../services/model-capabilities.js';
|
|
38
|
+
import { onSecretMutation } from '../core/secrets/index.js';
|
|
29
39
|
import { AgentPool } from './agent-pool.js';
|
|
40
|
+
import { addInferenceUsage, createCloudInferenceStreamFn, createInferenceUsageSummary, isStudiographCreditsMode, studiographCreditsModel, } from '../services/cloud-inference-billing.js';
|
|
30
41
|
export class AgentOrchestrator {
|
|
31
42
|
workspacePath;
|
|
32
43
|
workspaceManager;
|
|
@@ -37,7 +48,8 @@ export class AgentOrchestrator {
|
|
|
37
48
|
toolsDirs;
|
|
38
49
|
registryRef = { registry: null };
|
|
39
50
|
authService;
|
|
40
|
-
|
|
51
|
+
commentService;
|
|
52
|
+
chatSessionService;
|
|
41
53
|
recentMemory;
|
|
42
54
|
sessionsDir;
|
|
43
55
|
// Per-session context — used by tool closures via the pool's contextMap
|
|
@@ -52,24 +64,50 @@ export class AgentOrchestrator {
|
|
|
52
64
|
this.config = config.workspaceConfig;
|
|
53
65
|
this.gitUser = config.gitUser;
|
|
54
66
|
this.recentMemory = config.recentMemory;
|
|
55
|
-
|
|
56
|
-
|
|
67
|
+
// Prefer the route-level AuthService so we share the master-key
|
|
68
|
+
// crypto wiring + the OAuth-mutation pubsub. Fallback construction
|
|
69
|
+
// only fires in tests / CLI scenarios that don't supply one — those
|
|
70
|
+
// paths don't read encrypted oauth_tokens, so the missing crypto is
|
|
71
|
+
// harmless there.
|
|
72
|
+
this.authService = config.authService ?? new AuthService(config.workspacePath);
|
|
73
|
+
this.commentService = config.commentService ?? null;
|
|
74
|
+
this.chatSessionService = config.chatSessionService ?? null;
|
|
57
75
|
this.sessionsDir = join(homedir(), '.studiograph', 'sessions');
|
|
58
|
-
//
|
|
59
|
-
|
|
76
|
+
// Skills: filesystem dirs are now bundled-only. User/workspace authoring
|
|
77
|
+
// moves to graph `skill` entities (enumerated per-user in createAgentInstance).
|
|
60
78
|
const userToolsDir = join(homedir(), '.studiograph', 'tools');
|
|
61
|
-
const workspaceSkillsDir = join(this.workspacePath, '.studiograph', 'skills');
|
|
62
79
|
const workspaceToolsDir = join(this.workspacePath, '.studiograph', 'tools');
|
|
63
80
|
const bundledSkillsDir = join(__dirname, 'skills');
|
|
64
|
-
this.skillsDirs = [
|
|
81
|
+
this.skillsDirs = [bundledSkillsDir, ...(config.skillsDirs ?? [])];
|
|
65
82
|
this.toolsDirs = [userToolsDir, workspaceToolsDir, ...(config.toolsDirs ?? [])];
|
|
66
83
|
this.workspaceManager = config.workspaceManager ?? new WorkspaceManager(this.workspacePath, this.config, this.gitUser);
|
|
67
84
|
// Initialize agent pool — each session gets its own Agent instance
|
|
68
85
|
this.pool = new AgentPool({
|
|
69
86
|
createAgent: (userId) => this.createAgentInstance(userId),
|
|
70
|
-
loadCustomTools: (agent) => this.loadCustomToolsAsync(agent),
|
|
87
|
+
loadCustomTools: (agent, userId) => this.loadCustomToolsAsync(agent, userId),
|
|
71
88
|
sessionsDir: this.sessionsDir,
|
|
72
89
|
});
|
|
90
|
+
// Evict cached agents when an operator changes a model.* key via
|
|
91
|
+
// Settings UI / CLI. Without this, the running agent keeps using
|
|
92
|
+
// the apiKey/provider/modelId it captured at createAgentInstance
|
|
93
|
+
// time, and the operator's rotation appears to have no effect
|
|
94
|
+
// until the next process restart. Other keys (r2.*, search.*) are
|
|
95
|
+
// read fresh on each tool call, so eviction isn't needed for them.
|
|
96
|
+
onSecretMutation((key) => {
|
|
97
|
+
if (key.startsWith('model.')) {
|
|
98
|
+
this.pool.invalidateAll();
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
// Evict the user's pooled agent when their OAuth state changes.
|
|
102
|
+
// ConnectorManager.buildTools resolves per-user OAuth at agent-
|
|
103
|
+
// construction time only; mid-session connect/disconnect would
|
|
104
|
+
// otherwise leave the agent with a stale tool list (the connector
|
|
105
|
+
// would stay invisible after Connect, or stay visible after
|
|
106
|
+
// Disconnect). Scoped per-user — other users' sessions are
|
|
107
|
+
// untouched.
|
|
108
|
+
this.authService.onOAuthMutation((userId) => {
|
|
109
|
+
this.pool.invalidateUser(userId);
|
|
110
|
+
});
|
|
73
111
|
}
|
|
74
112
|
/**
|
|
75
113
|
* Create Pi-Mono agent with tools and system prompt.
|
|
@@ -77,15 +115,26 @@ export class AgentOrchestrator {
|
|
|
77
115
|
*/
|
|
78
116
|
createAgentInstance(userId) {
|
|
79
117
|
const userConfig = loadUserConfig();
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
const
|
|
118
|
+
const useCreditsGateway = isStudiographCreditsMode();
|
|
119
|
+
const provider = useCreditsGateway ? 'studiograph-cloud' : resolveProvider(userConfig, this.config);
|
|
120
|
+
const modelId = useCreditsGateway ? studiographCreditsModel().id : resolveModelId(userConfig, this.config);
|
|
121
|
+
const apiKey = useCreditsGateway ? 'studiograph-cloud-gateway' : resolveApiKey(userConfig, this.config);
|
|
83
122
|
if (!apiKey) {
|
|
84
123
|
throw new Error('API key not found in config or environment');
|
|
85
124
|
}
|
|
86
|
-
const model =
|
|
87
|
-
|
|
88
|
-
|
|
125
|
+
const model = useCreditsGateway
|
|
126
|
+
? studiographCreditsModel()
|
|
127
|
+
: getModel(provider, modelId);
|
|
128
|
+
// Build skill index — bundled filesystem skills + graph `skill` entries
|
|
129
|
+
// from folders the user can access. Graph skills take priority over
|
|
130
|
+
// bundled on name collision (user-authored overrides can customise
|
|
131
|
+
// built-in skills).
|
|
132
|
+
const promptRepos = this.getPromptRepoScope(userId);
|
|
133
|
+
const graphSkills = this.enumerateGraphSkills(promptRepos, userId);
|
|
134
|
+
const bundledSkills = loadSkillIndex(this.skillsDirs);
|
|
135
|
+
const seen = new Set(graphSkills.map((s) => s.name));
|
|
136
|
+
const skillIndex = [...graphSkills, ...bundledSkills.filter(s => !seen.has(s.name))];
|
|
137
|
+
const graphResolver = (repo, id) => this.readGraphSkillBody(repo, id);
|
|
89
138
|
// Build tools — closures read per-session context from the pool
|
|
90
139
|
// The pool sets context before each withAgent call, so these resolve correctly
|
|
91
140
|
// Closures that resolve per-session context at call time.
|
|
@@ -95,6 +144,13 @@ export class AgentOrchestrator {
|
|
|
95
144
|
const sid = this.pool.findSessionForAgent(agent);
|
|
96
145
|
return sid ? (this.pool.getContext(sid).user ?? null) : this._currentUser;
|
|
97
146
|
};
|
|
147
|
+
// The raw client session id for the active turn (scratch images are keyed by
|
|
148
|
+
// it). Resolved per call from the pool context so session-scoped tools target
|
|
149
|
+
// the current conversation. Null for non-web contexts that set no context.
|
|
150
|
+
const getActiveSessionId = () => {
|
|
151
|
+
const sid = this.pool.findSessionForAgent(agent);
|
|
152
|
+
return sid ? (this.pool.getContext(sid).clientSessionId ?? null) : null;
|
|
153
|
+
};
|
|
98
154
|
const onHighlight = (ids) => {
|
|
99
155
|
const sid = this.pool.findSessionForAgent(agent);
|
|
100
156
|
if (sid)
|
|
@@ -109,34 +165,103 @@ export class AgentOrchestrator {
|
|
|
109
165
|
else
|
|
110
166
|
this._mutationCallback?.(m);
|
|
111
167
|
};
|
|
168
|
+
const onArtifact = (bundle, target, options) => {
|
|
169
|
+
const sid = this.pool.findSessionForAgent(agent);
|
|
170
|
+
if (sid)
|
|
171
|
+
return this.pool.getContext(sid).onArtifact?.(bundle, target, options);
|
|
172
|
+
};
|
|
173
|
+
const readArtifact = (target) => {
|
|
174
|
+
const sid = this.pool.findSessionForAgent(agent);
|
|
175
|
+
const ctx = sid ? this.pool.getContext(sid) : { user: this._currentUser };
|
|
176
|
+
const effectiveTarget = target?.entityId ? target : ctx.currentArtifactTarget;
|
|
177
|
+
if (!effectiveTarget?.entityId) {
|
|
178
|
+
throw new Error('No artifact target is available. Pass target.entityId or open an artifact canvas first.');
|
|
179
|
+
}
|
|
180
|
+
if (!effectiveTarget.repo) {
|
|
181
|
+
throw new Error('Artifact target repo is required when inspecting by target.');
|
|
182
|
+
}
|
|
183
|
+
if (!access.hasRepoAccess(ctx.user ?? undefined, effectiveTarget.repo, this.workspaceManager, this.authService)) {
|
|
184
|
+
throw new Error(`Folder "${effectiveTarget.repo}" not found`);
|
|
185
|
+
}
|
|
186
|
+
const graph = this.workspaceManager.getGraph(effectiveTarget.repo);
|
|
187
|
+
const entity = graph.get('artifact', effectiveTarget.entityId);
|
|
188
|
+
// Prefer the live editor Y.Doc body over disk (matches get_entity /
|
|
189
|
+
// patch_entity), so the agent edits what the user currently sees and the
|
|
190
|
+
// hash matches the write-time guard's view of "current".
|
|
191
|
+
const body = graph.getLiveBody('artifact', effectiveTarget.entityId) ?? entity.document.content;
|
|
192
|
+
let rawBundle;
|
|
193
|
+
try {
|
|
194
|
+
rawBundle = JSON.parse(body);
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
throw new Error(`Artifact ${effectiveTarget.repo}/${effectiveTarget.entityId} body is not a valid JSON bundle.`);
|
|
198
|
+
}
|
|
199
|
+
const validation = validateArtifactBundle(rawBundle);
|
|
200
|
+
if (!validation.ok || !validation.bundle) {
|
|
201
|
+
throw new Error(`Invalid artifact bundle: ${validation.errors.join('; ')}`);
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
bundle: validation.bundle,
|
|
205
|
+
hash: hashArtifactBody(body),
|
|
206
|
+
updatedAt: typeof entity.data?.updated_at === 'string' ? entity.data.updated_at : undefined,
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
const onAgentActivity = (action, repo) => {
|
|
210
|
+
const sid = this.pool.findSessionForAgent(agent);
|
|
211
|
+
if (sid)
|
|
212
|
+
this.pool.getContext(sid).onAgentActivity?.(action, repo);
|
|
213
|
+
};
|
|
214
|
+
/** Resolves the per-session capture callback at tool-call time. The
|
|
215
|
+
* capture flow installs it via AgentContext; other flows leave it
|
|
216
|
+
* undefined and the tool becomes a no-op acknowledgement. */
|
|
217
|
+
const getNothingToCaptureCallback = () => {
|
|
218
|
+
const sid = this.pool.findSessionForAgent(agent);
|
|
219
|
+
if (!sid)
|
|
220
|
+
return undefined;
|
|
221
|
+
return this.pool.getContext(sid).onNothingToCapture ?? undefined;
|
|
222
|
+
};
|
|
112
223
|
const tools = [
|
|
113
|
-
...createGraphTools(this.workspaceManager, this.gitUser, this.workspacePath, onHighlight, onMutation, getUser, this.authService),
|
|
224
|
+
...createGraphTools(this.workspaceManager, this.gitUser, this.workspacePath, onHighlight, onMutation, getUser, this.authService, onAgentActivity, this.commentService, this.chatSessionService, getActiveSessionId),
|
|
225
|
+
...createFolderTools(this.workspaceManager, this.gitUser, onMutation, getUser, this.authService, onAgentActivity),
|
|
226
|
+
...createHistoryTools(this.workspaceManager, this.gitUser, onMutation, getUser, this.authService, onAgentActivity),
|
|
114
227
|
...createOpsTools(this.workspacePath, this.config),
|
|
115
|
-
...createPermissionTools(this.authService, getUser),
|
|
228
|
+
...createPermissionTools(this.authService, getUser, this.workspaceManager),
|
|
116
229
|
...createFsTools(getUser),
|
|
117
230
|
...createWebTools(this.config.search),
|
|
118
|
-
...(
|
|
119
|
-
|
|
231
|
+
...createCaptureTools(getNothingToCaptureCallback),
|
|
232
|
+
...createArtifactTools(onArtifact, { readArtifact }),
|
|
233
|
+
createLoadSkillTool(skillIndex, graphResolver),
|
|
120
234
|
];
|
|
121
|
-
//
|
|
122
|
-
|
|
123
|
-
if (userId) {
|
|
124
|
-
const cached = this.authService.getCachedBriefing(userId);
|
|
125
|
-
if (cached.briefingText)
|
|
126
|
-
briefingText = cached.briefingText;
|
|
127
|
-
}
|
|
128
|
-
// Build system prompt — base + auto-generated tool reference + memory + briefing + eager skills + skill index
|
|
129
|
-
const systemPrompt = this.buildSystemPrompt(skillIndex, tools, this.recentMemory, briefingText);
|
|
235
|
+
// Build system prompt — base + auto-generated tool reference + memory + eager skills + skill index
|
|
236
|
+
const systemPrompt = this.buildSystemPrompt(skillIndex, tools, this.recentMemory, graphResolver, promptRepos, userId);
|
|
130
237
|
// Log registered tools at startup (verbose only)
|
|
131
238
|
if (process.env.STUDIOGRAPH_VERBOSE === '1') {
|
|
132
239
|
console.log(`🔧 ${tools.length} tools registered: ${tools.map((t) => t.name).join(', ')}`);
|
|
133
240
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
241
|
+
// Dedup the bundled tools array — guards against any future
|
|
242
|
+
// createXxxTools() collision so we never hand a duplicate-name list
|
|
243
|
+
// to the Agent constructor (Anthropic 400s on `tools: Tool names must
|
|
244
|
+
// be unique.`).
|
|
245
|
+
const dedupedTools = [];
|
|
246
|
+
const bundledSeen = new Set();
|
|
247
|
+
for (const t of tools) {
|
|
248
|
+
const name = t.name;
|
|
249
|
+
if (!name || bundledSeen.has(name))
|
|
250
|
+
continue;
|
|
251
|
+
bundledSeen.add(name);
|
|
252
|
+
dedupedTools.push(t);
|
|
253
|
+
}
|
|
254
|
+
const agent = new Agent({
|
|
255
|
+
getApiKey: () => apiKey,
|
|
256
|
+
initialState: { model, systemPrompt, tools: dedupedTools },
|
|
257
|
+
streamFn: useCreditsGateway ? createCloudInferenceStreamFn() : undefined,
|
|
258
|
+
});
|
|
259
|
+
// Custom tools are loaded asynchronously by the pool wrapper
|
|
260
|
+
// (config.loadCustomTools, wired to loadCustomToolsAsync). Do NOT call
|
|
261
|
+
// it here — calling it twice fires two concurrent Promise.alls, both
|
|
262
|
+
// racing to mutate agent.state.tools, and the inter-microtask dedup
|
|
263
|
+
// can't always prevent Anthropic seeing a duplicated list on the very
|
|
264
|
+
// first prompt. Single fire site = no race.
|
|
140
265
|
return agent;
|
|
141
266
|
}
|
|
142
267
|
/**
|
|
@@ -144,12 +269,20 @@ export class AgentOrchestrator {
|
|
|
144
269
|
* Runs async after construction — custom tools may not be available for the
|
|
145
270
|
* very first message if initialisation is extremely fast, but in practice
|
|
146
271
|
* the first user message arrives well after startup.
|
|
272
|
+
*
|
|
273
|
+
* `userId` is forwarded into `ConnectorManager.buildTools` so per-user MCP
|
|
274
|
+
* OAuth tokens are resolved at tool-build time. Without it the runtime
|
|
275
|
+
* silently falls back to workspace-shared static headers (the deferred
|
|
276
|
+
* gap before 2026-05-13). The agent pool keys agents per-session and
|
|
277
|
+
* supplies the session's userId on creation; CLI / non-interactive
|
|
278
|
+
* spawns pass `undefined` and intentionally land on the workspace
|
|
279
|
+
* fallback.
|
|
147
280
|
*/
|
|
148
|
-
loadCustomToolsAsync(agent) {
|
|
281
|
+
loadCustomToolsAsync(agent, userId) {
|
|
149
282
|
const context = { workspaceManager: this.workspaceManager, gitUser: this.gitUser };
|
|
150
|
-
Promise.all([
|
|
283
|
+
return Promise.all([
|
|
151
284
|
loadCustomTools(this.toolsDirs, context),
|
|
152
|
-
ConnectorManager.buildTools(ConnectorManager.loadConfigs(this.workspacePath)),
|
|
285
|
+
ConnectorManager.buildTools(ConnectorManager.loadConfigs(this.workspacePath), { userId, authService: this.authService }),
|
|
153
286
|
]).then(([customTools, connectorTools]) => {
|
|
154
287
|
const extra = [...customTools];
|
|
155
288
|
if (connectorTools.length > 0) {
|
|
@@ -158,8 +291,27 @@ export class AgentOrchestrator {
|
|
|
158
291
|
this.registryRef.registry = registry;
|
|
159
292
|
}
|
|
160
293
|
if (extra.length > 0) {
|
|
294
|
+
// Dedup by name — this method can be invoked more than once per agent
|
|
295
|
+
// (createAgentInstance schedules it, and the pool also calls it via
|
|
296
|
+
// its loadCustomTools callback). Without dedup we end up with
|
|
297
|
+
// duplicate tool registrations, which Anthropic rejects on the next
|
|
298
|
+
// turn with: 400 "tools: Tool names must be unique."
|
|
161
299
|
const existing = agent.state.tools;
|
|
162
|
-
|
|
300
|
+
const seen = new Set(existing.map((t) => t.name));
|
|
301
|
+
const merged = [...existing];
|
|
302
|
+
for (const t of extra) {
|
|
303
|
+
if (seen.has(t.name))
|
|
304
|
+
continue;
|
|
305
|
+
seen.add(t.name);
|
|
306
|
+
merged.push(t);
|
|
307
|
+
}
|
|
308
|
+
if (merged.length !== existing.length) {
|
|
309
|
+
agent.state.tools = merged;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
if (process.env.STUDIOGRAPH_VERBOSE === '1') {
|
|
313
|
+
// eslint-disable-next-line no-console
|
|
314
|
+
console.log(`[orchestrator] loadCustomToolsAsync done: customTools=${customTools.length}, connectorTools=${connectorTools.length}, total agent.state.tools=${agent.state.tools.length}`);
|
|
163
315
|
}
|
|
164
316
|
}).catch(err => {
|
|
165
317
|
console.warn('Failed to load custom/connector tools:', err);
|
|
@@ -168,11 +320,11 @@ export class AgentOrchestrator {
|
|
|
168
320
|
/**
|
|
169
321
|
* Build the full system prompt: base prompt + eager skill content + skill index.
|
|
170
322
|
*/
|
|
171
|
-
buildSystemPrompt(skillIndex, tools, recentMemory,
|
|
323
|
+
buildSystemPrompt(skillIndex, tools, recentMemory, graphResolver, promptRepos = this.workspaceManager.getContentRepoConfigs(), userId) {
|
|
172
324
|
const promptPath = join(__dirname, 'prompts', 'system.md');
|
|
173
325
|
let base = existsSync(promptPath)
|
|
174
326
|
? readFileSync(promptPath, 'utf-8')
|
|
175
|
-
: this.getDefaultSystemPrompt();
|
|
327
|
+
: this.getDefaultSystemPrompt(promptRepos);
|
|
176
328
|
// Auto-generate tool reference from registered tools, grouped by category
|
|
177
329
|
const categories = {
|
|
178
330
|
'Entity Management': [],
|
|
@@ -194,8 +346,14 @@ export class AgentOrchestrator {
|
|
|
194
346
|
categories['Operations'].push(t);
|
|
195
347
|
else if (name === 'load_skill')
|
|
196
348
|
categories['Skills'].push(t);
|
|
349
|
+
else if (['create_artifact', 'inspect_artifact'].includes(name))
|
|
350
|
+
(categories['Artifacts'] ??= []).push(t);
|
|
197
351
|
else if (['create_entity', 'get_entity', 'update_entity', 'delete_entity', 'search_entities', 'list_entities', 'get_related', 'get_backlinks', 'validate_wikilinks', 'get_workspace_summary', 'list_repos', 'query_dataset', 'append_rows', 'get_entity_schema', 'lint_entities'].includes(name))
|
|
198
352
|
categories['Entity Management'].push(t);
|
|
353
|
+
else if (['create_folder', 'create_subfolder', 'rename_folder', 'delete_folder', 'list_folders', 'move_entity', 'transfer_entity'].includes(name))
|
|
354
|
+
(categories['Folders'] ??= []).push(t);
|
|
355
|
+
else if (['list_file_history', 'list_folder_history', 'list_recent_deletions', 'read_file_at_commit', 'get_entity_diff', 'restore_file'].includes(name))
|
|
356
|
+
(categories['Git History'] ??= []).push(t);
|
|
199
357
|
else
|
|
200
358
|
categories['Other'].push(t);
|
|
201
359
|
}
|
|
@@ -204,10 +362,16 @@ export class AgentOrchestrator {
|
|
|
204
362
|
.map(([cat, items]) => `**${cat}:**\n${items.map((t) => `- \`${t.name}\` — ${t.description}`).join('\n')}`)
|
|
205
363
|
.join('\n\n');
|
|
206
364
|
base = base.replace('{{TOOL_REFERENCE}}', toolRef);
|
|
365
|
+
// Render the agent-visible entity type list from the launch allowlist +
|
|
366
|
+
// any workspace-defined custom types.
|
|
367
|
+
const registry = this.workspaceManager.getSchemaRegistry();
|
|
368
|
+
const builtinTypes = new Set(Object.keys(ENTITY_SCHEMAS));
|
|
369
|
+
const customTypes = registry.getAllTypes().filter(t => !builtinTypes.has(t));
|
|
370
|
+
base = base.replace('{{ENTITY_TYPES}}', renderEntityTypesSection({ customTypes }));
|
|
207
371
|
const parts = [base.trim()];
|
|
208
372
|
// Inject workspace identity from graph entities (org, team, capabilities, guidelines)
|
|
209
373
|
// Falls back to ABOUT.md if the graph has no organization entries
|
|
210
|
-
const identitySection = this.buildWorkspaceIdentity();
|
|
374
|
+
const identitySection = this.buildWorkspaceIdentity(promptRepos);
|
|
211
375
|
if (identitySection) {
|
|
212
376
|
parts.push(identitySection);
|
|
213
377
|
}
|
|
@@ -225,18 +389,40 @@ export class AgentOrchestrator {
|
|
|
225
389
|
if (schemaSection) {
|
|
226
390
|
parts.push(schemaSection);
|
|
227
391
|
}
|
|
392
|
+
// Inject per-repo subfolder inventory so the agent knows the existing
|
|
393
|
+
// folder layout without calling list_folders for every routing decision.
|
|
394
|
+
// Capped per-repo to keep system prompt size bounded.
|
|
395
|
+
const folderInventory = this.buildFolderInventory(promptRepos);
|
|
396
|
+
if (folderInventory) {
|
|
397
|
+
parts.push(folderInventory);
|
|
398
|
+
}
|
|
228
399
|
// Inject recent memory context (today + yesterday daily memory)
|
|
229
400
|
if (recentMemory) {
|
|
230
401
|
parts.push(`## Memory Context\n\n${recentMemory}`);
|
|
231
402
|
}
|
|
232
|
-
// Inject
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
403
|
+
// Inject current-user identity + bridge so the agent can read its own
|
|
404
|
+
// handle and the linked person entity from the prompt instead of
|
|
405
|
+
// having to call list_users on every turn.
|
|
406
|
+
if (userId) {
|
|
407
|
+
const u = this.authService.findUserById(userId);
|
|
408
|
+
if (u) {
|
|
409
|
+
const ref = findPersonRefForUser(this.workspaceManager, u.handle);
|
|
410
|
+
const lines = [
|
|
411
|
+
`## Current User`,
|
|
412
|
+
``,
|
|
413
|
+
`- Display name: ${u.displayName}`,
|
|
414
|
+
`- Handle: \`${u.handle}\` (use this for created_by/updated_by audit, @mentions, and link_person_to_user)`,
|
|
415
|
+
`- Email: ${u.email}`,
|
|
416
|
+
`- Role: ${u.role}`,
|
|
417
|
+
ref
|
|
418
|
+
? `- Linked person entity: \`[[${ref.entityId}]]\` in \`${ref.repo}\` — when the user refers to themselves, this is their record. Write enrichments here via update_entity; never call link_person_to_user for the current user.`
|
|
419
|
+
: `- Linked person entity: **none.** This account has no person record yet (new/legacy account, or a previously-linked record was deleted). The link is optional but powers their "My Tasks", @mentions, and lets teammates assign tasks to them. If they'd like to link, offer to either (a) find an existing person record that is them and link it (search_entities → link_person_to_user), or (b) create a person entity for them and link it (create_entity → link_person_to_user). You can also point them to Settings → Profile → "Create & link" for a one-click repair. Don't push workspace-wide config changes for this.`,
|
|
420
|
+
];
|
|
421
|
+
parts.push(lines.join('\n'));
|
|
422
|
+
}
|
|
237
423
|
}
|
|
238
424
|
// Inline eager skills directly into the system prompt
|
|
239
|
-
const eagerContent = loadEagerSkills(skillIndex);
|
|
425
|
+
const eagerContent = loadEagerSkills(skillIndex, graphResolver);
|
|
240
426
|
if (eagerContent) {
|
|
241
427
|
parts.push(eagerContent);
|
|
242
428
|
}
|
|
@@ -247,15 +433,90 @@ export class AgentOrchestrator {
|
|
|
247
433
|
}
|
|
248
434
|
return parts.join('\n\n');
|
|
249
435
|
}
|
|
436
|
+
/**
|
|
437
|
+
* Enumerate skill entities across all folders the user can access. Each
|
|
438
|
+
* skill becomes a SkillMeta with a `graph://<repo>/<id>` sentinel
|
|
439
|
+
* entrypoint. Priority order: user's private folder first, then shared
|
|
440
|
+
* folders alphabetically. First occurrence of a given name wins.
|
|
441
|
+
*/
|
|
442
|
+
getPromptRepoScope(userId) {
|
|
443
|
+
if (!userId)
|
|
444
|
+
return this.workspaceManager.getAllRepoConfigs();
|
|
445
|
+
const user = this.authService.findUserById(userId);
|
|
446
|
+
if (!user)
|
|
447
|
+
return [];
|
|
448
|
+
return access.getAccessibleRepos(user, this.workspaceManager, this.authService);
|
|
449
|
+
}
|
|
450
|
+
enumerateGraphSkills(accessibleRepos, userId) {
|
|
451
|
+
const skills = [];
|
|
452
|
+
const seen = new Set();
|
|
453
|
+
const personalRepo = userId ? this.workspaceManager.getUserPersonalRepo(userId) : undefined;
|
|
454
|
+
const sortedRepos = [...accessibleRepos]
|
|
455
|
+
.sort((a, b) => {
|
|
456
|
+
if (personalRepo && a.name === personalRepo.name)
|
|
457
|
+
return -1;
|
|
458
|
+
if (personalRepo && b.name === personalRepo.name)
|
|
459
|
+
return 1;
|
|
460
|
+
return a.name.localeCompare(b.name);
|
|
461
|
+
});
|
|
462
|
+
for (const repo of sortedRepos) {
|
|
463
|
+
try {
|
|
464
|
+
const graph = this.workspaceManager.getGraph(repo.name);
|
|
465
|
+
const entries = graph.list('skill');
|
|
466
|
+
for (const entry of entries) {
|
|
467
|
+
if (seen.has(entry.id))
|
|
468
|
+
continue;
|
|
469
|
+
seen.add(entry.id);
|
|
470
|
+
const data = entry.data;
|
|
471
|
+
skills.push({
|
|
472
|
+
name: entry.id,
|
|
473
|
+
description: typeof data.description === 'string' ? data.description : '',
|
|
474
|
+
loading: data.loading === 'eager' ? 'eager' : 'on-demand',
|
|
475
|
+
dir: `graph://${repo.name}`,
|
|
476
|
+
entrypoint: `graph://${repo.name}/${entry.id}`,
|
|
477
|
+
isDirectory: false,
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
catch {
|
|
482
|
+
// skip repos that fail to load
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
return skills;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Load the markdown body of a skill entity by (repo, id).
|
|
489
|
+
*/
|
|
490
|
+
readGraphSkillBody(repo, id) {
|
|
491
|
+
try {
|
|
492
|
+
const graph = this.workspaceManager.getGraph(repo);
|
|
493
|
+
const entries = graph.list('skill');
|
|
494
|
+
const entry = entries.find(e => e.id === id);
|
|
495
|
+
if (!entry)
|
|
496
|
+
return `Error: skill "${id}" not found in folder "${repo}".`;
|
|
497
|
+
return entry.document?.content ?? '';
|
|
498
|
+
}
|
|
499
|
+
catch (e) {
|
|
500
|
+
return `Error loading skill "${id}" from "${repo}": ${e?.message ?? e}`;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
250
503
|
/**
|
|
251
504
|
* Build a workspace identity section from graph entities.
|
|
252
505
|
* Reads organization, person, practice-area, and guideline entries
|
|
253
506
|
* to compose a concise identity summary for the system prompt.
|
|
254
507
|
* Returns null if no organization entries exist.
|
|
255
508
|
*/
|
|
256
|
-
buildWorkspaceIdentity() {
|
|
509
|
+
buildWorkspaceIdentity(repos) {
|
|
257
510
|
try {
|
|
258
|
-
const
|
|
511
|
+
const listScoped = (entityType) => repos.flatMap(repo => {
|
|
512
|
+
try {
|
|
513
|
+
return this.workspaceManager.getGraph(repo.name).list(entityType);
|
|
514
|
+
}
|
|
515
|
+
catch {
|
|
516
|
+
return [];
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
const orgs = listScoped('organization');
|
|
259
520
|
if (orgs.length === 0)
|
|
260
521
|
return null;
|
|
261
522
|
const lines = ['## Workspace Identity'];
|
|
@@ -271,7 +532,7 @@ export class AgentOrchestrator {
|
|
|
271
532
|
}
|
|
272
533
|
}
|
|
273
534
|
// Team
|
|
274
|
-
const people =
|
|
535
|
+
const people = listScoped('person');
|
|
275
536
|
if (people.length > 0) {
|
|
276
537
|
lines.push('\n### Team');
|
|
277
538
|
for (const person of people.slice(0, 15)) {
|
|
@@ -281,14 +542,19 @@ export class AgentOrchestrator {
|
|
|
281
542
|
lines.push(`- ${name}${role}${location}`);
|
|
282
543
|
}
|
|
283
544
|
}
|
|
284
|
-
//
|
|
285
|
-
const
|
|
286
|
-
if (
|
|
545
|
+
// Services (capabilities + methodologies — replaces former practice areas)
|
|
546
|
+
const services = listScoped('service');
|
|
547
|
+
if (services.length > 0) {
|
|
287
548
|
lines.push('\n### Capabilities');
|
|
288
|
-
|
|
549
|
+
// Top-level services (no `sprint` parent) read as the firm's overall
|
|
550
|
+
// capabilities; nested services are sprint-level details. Surface
|
|
551
|
+
// top-level only here to keep the system prompt compact.
|
|
552
|
+
const topLevel = services.filter(s => !s.data.sprint);
|
|
553
|
+
const list = topLevel.length > 0 ? topLevel : services;
|
|
554
|
+
lines.push(list.map(s => s.data.name || s.id).join(', '));
|
|
289
555
|
}
|
|
290
|
-
// Guidelines (communication style, preferences)
|
|
291
|
-
const guidelines =
|
|
556
|
+
// Guidelines (communication style, preferences) — now document.category=guideline
|
|
557
|
+
const guidelines = listScoped('document').filter(d => d.data.category === 'guideline');
|
|
292
558
|
if (guidelines.length > 0) {
|
|
293
559
|
lines.push('\n### Guidelines');
|
|
294
560
|
for (const g of guidelines.slice(0, 5)) {
|
|
@@ -306,13 +572,62 @@ export class AgentOrchestrator {
|
|
|
306
572
|
return null;
|
|
307
573
|
}
|
|
308
574
|
}
|
|
575
|
+
/**
|
|
576
|
+
* Per-repo subfolder summary for the system prompt. Lists each accessible
|
|
577
|
+
* repo with up to MAX_PER_REPO subfolder paths so the agent can route new
|
|
578
|
+
* entries into existing folders without calling list_folders for every
|
|
579
|
+
* decision. Refresh cadence is per-session (system prompt is built once).
|
|
580
|
+
*/
|
|
581
|
+
buildFolderInventory(repos) {
|
|
582
|
+
const MAX_PER_REPO = 8;
|
|
583
|
+
// System folders (the reserved asset store) are never a place the agent
|
|
584
|
+
// should create entries — keep them out of the folder inventory.
|
|
585
|
+
repos = repos.filter(r => !r.system);
|
|
586
|
+
if (repos.length === 0)
|
|
587
|
+
return null;
|
|
588
|
+
const lines = [];
|
|
589
|
+
for (const repo of repos) {
|
|
590
|
+
let folders = [];
|
|
591
|
+
try {
|
|
592
|
+
folders = this.workspaceManager.getGraph(repo.name).listFolders();
|
|
593
|
+
}
|
|
594
|
+
catch {
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
const display = repo.display_name || repo.name;
|
|
598
|
+
if (folders.length === 0) {
|
|
599
|
+
lines.push(`- **${display}** (\`${repo.name}\`): no subfolders`);
|
|
600
|
+
}
|
|
601
|
+
else {
|
|
602
|
+
// Render `path` plus an explicit display_name override in quotes when one
|
|
603
|
+
// exists — so the agent can refer to folders by their human label (e.g. in
|
|
604
|
+
// follow-up suggestions) instead of the kebab path. Folders without an
|
|
605
|
+
// override title-case the last segment for display.
|
|
606
|
+
const shown = folders
|
|
607
|
+
.slice(0, MAX_PER_REPO)
|
|
608
|
+
.map(f => (f.display_name ? `\`${f.path}\` ("${f.display_name}")` : `\`${f.path}\``))
|
|
609
|
+
.join(', ');
|
|
610
|
+
const more = folders.length > MAX_PER_REPO ? ` (+${folders.length - MAX_PER_REPO} more)` : '';
|
|
611
|
+
lines.push(`- **${display}** (\`${repo.name}\`): ${shown}${more}`);
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
if (lines.length === 0)
|
|
615
|
+
return null;
|
|
616
|
+
return `## Folder Inventory\n\nExisting subfolders per repo. Prefer placing new entries in an existing folder when one fits. Folder paths are repo-relative POSIX; a quoted "Display Name" after a path is that folder's human label.\n\n${lines.join('\n')}`;
|
|
617
|
+
}
|
|
309
618
|
/**
|
|
310
619
|
* Fallback system prompt when prompts/system.md is not found.
|
|
311
620
|
*/
|
|
312
|
-
getDefaultSystemPrompt() {
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
|
|
621
|
+
getDefaultSystemPrompt(promptRepos = this.workspaceManager.getContentRepoConfigs()) {
|
|
622
|
+
const totalEntities = promptRepos.reduce((count, repo) => {
|
|
623
|
+
try {
|
|
624
|
+
return count + this.workspaceManager.getGraph(repo.name).search({}).length;
|
|
625
|
+
}
|
|
626
|
+
catch {
|
|
627
|
+
return count;
|
|
628
|
+
}
|
|
629
|
+
}, 0);
|
|
630
|
+
const repoList = promptRepos
|
|
316
631
|
.map(r => ` - ${r.name} (${r.type}): ${r.description}`)
|
|
317
632
|
.join('\n');
|
|
318
633
|
return `# Studiograph AI Assistant
|
|
@@ -322,8 +637,8 @@ You are Studiograph, an AI assistant helping creative teams manage their knowled
|
|
|
322
637
|
## Workspace
|
|
323
638
|
|
|
324
639
|
**Team:** ${this.config.team_name}
|
|
325
|
-
**Repositories:** ${
|
|
326
|
-
**Total Entities:** ${
|
|
640
|
+
**Repositories:** ${promptRepos.length}
|
|
641
|
+
**Total Entities:** ${totalEntities}
|
|
327
642
|
|
|
328
643
|
**Available Repositories:**
|
|
329
644
|
${repoList}`;
|
|
@@ -346,10 +661,12 @@ ${repoList}`;
|
|
|
346
661
|
return new Promise((resolve, reject) => {
|
|
347
662
|
let content = '';
|
|
348
663
|
const toolCalls = [];
|
|
664
|
+
const usage = createInferenceUsageSummary();
|
|
349
665
|
const unsubscribe = agent.subscribe((event) => {
|
|
350
666
|
if (event.type === 'message_end') {
|
|
351
667
|
const msg = event.message;
|
|
352
668
|
if (msg?.role === 'assistant') {
|
|
669
|
+
addInferenceUsage(usage, msg.usage);
|
|
353
670
|
content = msg.content
|
|
354
671
|
.filter((b) => b.type === 'text')
|
|
355
672
|
.map((b) => b.text)
|
|
@@ -363,7 +680,7 @@ ${repoList}`;
|
|
|
363
680
|
}
|
|
364
681
|
else if (event.type === 'agent_end') {
|
|
365
682
|
unsubscribe();
|
|
366
|
-
resolve({ content, toolCalls });
|
|
683
|
+
resolve({ content, toolCalls, usage });
|
|
367
684
|
}
|
|
368
685
|
});
|
|
369
686
|
agent.prompt(userMessage).catch((error) => {
|
|
@@ -383,10 +700,12 @@ ${repoList}`;
|
|
|
383
700
|
return new Promise((resolve, reject) => {
|
|
384
701
|
let content = '';
|
|
385
702
|
const toolCalls = [];
|
|
703
|
+
const usage = createInferenceUsageSummary();
|
|
386
704
|
const unsubscribe = agent.subscribe((event) => {
|
|
387
705
|
if (event.type === 'message_end') {
|
|
388
706
|
const msg = event.message;
|
|
389
707
|
if (msg?.role === 'assistant') {
|
|
708
|
+
addInferenceUsage(usage, msg.usage);
|
|
390
709
|
content = msg.content
|
|
391
710
|
.filter((b) => b.type === 'text')
|
|
392
711
|
.map((b) => b.text)
|
|
@@ -400,7 +719,7 @@ ${repoList}`;
|
|
|
400
719
|
}
|
|
401
720
|
else if (event.type === 'agent_end') {
|
|
402
721
|
unsubscribe();
|
|
403
|
-
resolve({ content, toolCalls });
|
|
722
|
+
resolve({ content, toolCalls, usage });
|
|
404
723
|
}
|
|
405
724
|
});
|
|
406
725
|
agent.prompt(userMessage).catch((error) => {
|
|
@@ -416,6 +735,85 @@ ${repoList}`;
|
|
|
416
735
|
getWorkspaceManager() {
|
|
417
736
|
return this.workspaceManager;
|
|
418
737
|
}
|
|
738
|
+
getModelSelection() {
|
|
739
|
+
const userConfig = loadUserConfig();
|
|
740
|
+
return {
|
|
741
|
+
provider: resolveProvider(userConfig, this.config),
|
|
742
|
+
modelId: resolveModelId(userConfig, this.config),
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
/** Can the active chat model accept image input? Drives the composer's
|
|
746
|
+
* vision-attach affordance (disable + tooltip when false). The Studiograph
|
|
747
|
+
* Credits gateway is vision-capable (A6); otherwise resolve from the model. */
|
|
748
|
+
supportsVision() {
|
|
749
|
+
if (isStudiographCreditsMode())
|
|
750
|
+
return true;
|
|
751
|
+
const { provider, modelId } = this.getModelSelection();
|
|
752
|
+
return supportsVision(provider, modelId);
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Delete the agent-pool's persisted state for a chat session — evicts the warm
|
|
756
|
+
* agent + unlinks its on-disk JSON, which holds base64 copies of any vision
|
|
757
|
+
* images the agent saw. Called when a chat is deleted so those copies don't
|
|
758
|
+
* outlive the conversation (composer-vision cleanup). `rawSessionId` is the
|
|
759
|
+
* client session id; the pool keys by the resolved `user:{id}:{raw}` form.
|
|
760
|
+
*/
|
|
761
|
+
deleteChatSessionState(userId, rawSessionId) {
|
|
762
|
+
this.pool.deleteSession(userId, `user:${userId}:${rawSessionId}`);
|
|
763
|
+
}
|
|
764
|
+
/** Delete agent-pool state for ALL of a user's chats (reset / delete-all). */
|
|
765
|
+
deleteAllChatSessionState(userId) {
|
|
766
|
+
this.pool.deleteAllSessions(userId);
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* One-shot, tool-free model call that names a conversation from its opening
|
|
770
|
+
* exchange (the ChatGPT pattern). Used by POST /api/chat/title after the
|
|
771
|
+
* first assistant reply. Deliberately lightweight: no agent pool, no tools,
|
|
772
|
+
* no system context — just the configured model and a tight instruction.
|
|
773
|
+
*
|
|
774
|
+
* Returns null (caller keeps the truncated first-message title) when there's
|
|
775
|
+
* no usable title, no API key, or we're in Studiograph Credits gateway mode —
|
|
776
|
+
* the gateway routes inference through its own client (cloud-inference-billing),
|
|
777
|
+
* not pi-ai's complete(), so a direct completeSimple() can't reach it. Titles
|
|
778
|
+
* via the gateway are a follow-up if we want them.
|
|
779
|
+
*/
|
|
780
|
+
async generateConversationTitle(firstUserMessage, assistantReply) {
|
|
781
|
+
if (isStudiographCreditsMode())
|
|
782
|
+
return null;
|
|
783
|
+
const userConfig = loadUserConfig();
|
|
784
|
+
const provider = resolveProvider(userConfig, this.config);
|
|
785
|
+
const modelId = resolveModelId(userConfig, this.config);
|
|
786
|
+
const apiKey = resolveApiKey(userConfig, this.config);
|
|
787
|
+
if (!apiKey)
|
|
788
|
+
return null;
|
|
789
|
+
const model = getModel(provider, modelId);
|
|
790
|
+
const systemPrompt = 'You name a conversation from its opening exchange. Reply with ONLY the ' +
|
|
791
|
+
'title: 3 to 6 words, Title Case, no surrounding quotes, no trailing ' +
|
|
792
|
+
'punctuation. Describe the topic, not the speaker (e.g. "Cooper Hewitt ' +
|
|
793
|
+
'DEM Sync Notes", not "User Talks About a Meeting").';
|
|
794
|
+
const userText = `First message:\n${firstUserMessage}\n\nAssistant reply:\n${assistantReply}`.slice(0, 2000);
|
|
795
|
+
// No `temperature` — newer models (e.g. claude-opus-4-7) reject it with a
|
|
796
|
+
// 400 "temperature is deprecated for this model". maxTokens is plenty for a
|
|
797
|
+
// few-word title.
|
|
798
|
+
const result = await completeSimple(model, { systemPrompt, messages: [{ role: 'user', content: userText, timestamp: Date.now() }] }, { apiKey, maxTokens: 32 });
|
|
799
|
+
// Surface provider errors (e.g. a rejected option) so the route logs them
|
|
800
|
+
// instead of silently returning null and the client keeping its fallback.
|
|
801
|
+
if (result.stopReason === 'error') {
|
|
802
|
+
throw new Error(result.errorMessage || 'title model call failed');
|
|
803
|
+
}
|
|
804
|
+
const raw = result.content
|
|
805
|
+
.filter((c) => c.type === 'text')
|
|
806
|
+
.map((c) => c.text)
|
|
807
|
+
.join('')
|
|
808
|
+
.trim();
|
|
809
|
+
// Strip wrapping quotes / trailing punctuation the model may add anyway.
|
|
810
|
+
const title = raw.replace(/^["'`]+|["'`]+$/g, '').replace(/[.!?]+$/, '').trim().slice(0, 60);
|
|
811
|
+
if (!title)
|
|
812
|
+
return null;
|
|
813
|
+
const usage = createInferenceUsageSummary();
|
|
814
|
+
addInferenceUsage(usage, result.usage);
|
|
815
|
+
return { title, usage };
|
|
816
|
+
}
|
|
419
817
|
/**
|
|
420
818
|
* Get workspace summary
|
|
421
819
|
*/
|
|
@@ -429,7 +827,7 @@ ${repoList}`;
|
|
|
429
827
|
return this.workspaceManager.getRepoNames();
|
|
430
828
|
}
|
|
431
829
|
/**
|
|
432
|
-
* Set the current authenticated user for per-
|
|
830
|
+
* Set the current authenticated user for per-folder access filtering.
|
|
433
831
|
* Called per-request by the chat endpoint. Null = full access (API key / open mode).
|
|
434
832
|
*/
|
|
435
833
|
setCurrentUser(user) {
|