aimeat 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.env.example +15 -0
- package/dist/bin/aimeat.js +0 -0
- package/dist/locales/en.json +291 -8
- package/dist/locales/fi.json +291 -8
- package/dist/public/css/views/admin.css +97 -0
- package/dist/public/css/views/agents-detail.css +563 -0
- package/dist/public/css/views/foundry.css +1 -0
- package/dist/public/css/views/marketplace.css +1 -0
- package/dist/public/css/views/profile.css +2 -0
- package/dist/public/js/services/admin.js +20 -1
- package/dist/public/js/services/agent-activity.js +20 -0
- package/dist/public/js/services/agent-capabilities.js +15 -0
- package/dist/public/js/services/agent-directives.js +28 -0
- package/dist/public/js/services/agent-messages.js +34 -0
- package/dist/public/js/services/agent-services.js +17 -0
- package/dist/public/js/services/agent-tasks.js +46 -0
- package/dist/public/js/services/memory.js +6 -3
- package/dist/public/js/services/sharing-groups.js +51 -0
- package/dist/public/spa.html +21 -2
- package/dist/public/views/admin/agent-tasks-tab.js +156 -0
- package/dist/public/views/admin/federation-tab.js +60 -0
- package/dist/public/views/admin/memory-tab.js +1 -0
- package/dist/public/views/admin/overview-tab.js +25 -0
- package/dist/public/views/admin/sharing-groups-tab.js +86 -0
- package/dist/public/views/admin/stats-tab.js +480 -187
- package/dist/public/views/admin.js +4 -0
- package/dist/public/views/profile/access-tab.js +511 -5
- package/dist/public/views/profile/agents-activity-subtab.js +242 -0
- package/dist/public/views/profile/agents-capabilities-subtab.js +165 -0
- package/dist/public/views/profile/agents-directives-subtab.js +292 -0
- package/dist/public/views/profile/agents-messages-subtab.js +222 -0
- package/dist/public/views/profile/agents-services-subtab.js +111 -0
- package/dist/public/views/profile/agents-tab.js +94 -47
- package/dist/public/views/profile/agents-tasks-subtab.js +254 -0
- package/dist/public/views/profile/knowledge-tab.js +5 -5
- package/dist/public/views/profile/memory-tab.js +90 -25
- package/dist/src/auth/node-keys.d.ts.map +1 -1
- package/dist/src/auth/node-keys.js +3 -0
- package/dist/src/auth/node-keys.js.map +1 -1
- package/dist/src/config.d.ts +18 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +23 -2
- package/dist/src/config.js.map +1 -1
- package/dist/src/index.js +41 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/agent-capabilities.d.ts +18 -0
- package/dist/src/mcp/agent-capabilities.d.ts.map +1 -0
- package/dist/src/mcp/agent-capabilities.js +85 -0
- package/dist/src/mcp/agent-capabilities.js.map +1 -0
- package/dist/src/mcp/agent-messages.d.ts +15 -0
- package/dist/src/mcp/agent-messages.d.ts.map +1 -0
- package/dist/src/mcp/agent-messages.js +81 -0
- package/dist/src/mcp/agent-messages.js.map +1 -0
- package/dist/src/mcp/agent-tasks.d.ts +16 -0
- package/dist/src/mcp/agent-tasks.d.ts.map +1 -0
- package/dist/src/mcp/agent-tasks.js +350 -0
- package/dist/src/mcp/agent-tasks.js.map +1 -0
- package/dist/src/mcp/core.d.ts.map +1 -1
- package/dist/src/mcp/core.js +8 -4
- package/dist/src/mcp/core.js.map +1 -1
- package/dist/src/mcp/extensions.js +1 -1
- package/dist/src/mcp/extensions.js.map +1 -1
- package/dist/src/mcp/index.d.ts.map +1 -1
- package/dist/src/mcp/index.js +8 -0
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/mcp/memory-extended.js +1 -1
- package/dist/src/mcp/memory-extended.js.map +1 -1
- package/dist/src/mcp/sharing-groups.d.ts +16 -0
- package/dist/src/mcp/sharing-groups.d.ts.map +1 -0
- package/dist/src/mcp/sharing-groups.js +240 -0
- package/dist/src/mcp/sharing-groups.js.map +1 -0
- package/dist/src/middleware/rate-limit.d.ts.map +1 -1
- package/dist/src/middleware/rate-limit.js +4 -1
- package/dist/src/middleware/rate-limit.js.map +1 -1
- package/dist/src/models/agent-capabilities-schemas.d.ts +20 -0
- package/dist/src/models/agent-capabilities-schemas.d.ts.map +1 -0
- package/dist/src/models/agent-capabilities-schemas.js +16 -0
- package/dist/src/models/agent-capabilities-schemas.js.map +1 -0
- package/dist/src/models/agent-directives-schemas.d.ts +44 -0
- package/dist/src/models/agent-directives-schemas.d.ts.map +1 -0
- package/dist/src/models/agent-directives-schemas.js +41 -0
- package/dist/src/models/agent-directives-schemas.js.map +1 -0
- package/dist/src/models/agent-message-schemas.d.ts +32 -0
- package/dist/src/models/agent-message-schemas.d.ts.map +1 -0
- package/dist/src/models/agent-message-schemas.js +25 -0
- package/dist/src/models/agent-message-schemas.js.map +1 -0
- package/dist/src/models/agent-task-schemas.d.ts +133 -0
- package/dist/src/models/agent-task-schemas.d.ts.map +1 -0
- package/dist/src/models/agent-task-schemas.js +84 -0
- package/dist/src/models/agent-task-schemas.js.map +1 -0
- package/dist/src/models/schemas.d.ts +50 -0
- package/dist/src/models/schemas.d.ts.map +1 -1
- package/dist/src/models/schemas.js +42 -4
- package/dist/src/models/schemas.js.map +1 -1
- package/dist/src/models/sharing-group-schemas.d.ts +52 -0
- package/dist/src/models/sharing-group-schemas.d.ts.map +1 -0
- package/dist/src/models/sharing-group-schemas.js +46 -0
- package/dist/src/models/sharing-group-schemas.js.map +1 -0
- package/dist/src/routes/actions.d.ts.map +1 -1
- package/dist/src/routes/actions.js +1 -0
- package/dist/src/routes/actions.js.map +1 -1
- package/dist/src/routes/admin-agent-tasks.d.ts +12 -0
- package/dist/src/routes/admin-agent-tasks.d.ts.map +1 -0
- package/dist/src/routes/admin-agent-tasks.js +62 -0
- package/dist/src/routes/admin-agent-tasks.js.map +1 -0
- package/dist/src/routes/admin-monitoring.d.ts +2 -1
- package/dist/src/routes/admin-monitoring.d.ts.map +1 -1
- package/dist/src/routes/admin-monitoring.js +82 -2
- package/dist/src/routes/admin-monitoring.js.map +1 -1
- package/dist/src/routes/admin-sharing-groups.d.ts +12 -0
- package/dist/src/routes/admin-sharing-groups.d.ts.map +1 -0
- package/dist/src/routes/admin-sharing-groups.js +37 -0
- package/dist/src/routes/admin-sharing-groups.js.map +1 -0
- package/dist/src/routes/admin.d.ts +1 -1
- package/dist/src/routes/admin.d.ts.map +1 -1
- package/dist/src/routes/admin.js +35 -17
- package/dist/src/routes/admin.js.map +1 -1
- package/dist/src/routes/agent-activity.d.ts +17 -0
- package/dist/src/routes/agent-activity.d.ts.map +1 -0
- package/dist/src/routes/agent-activity.js +130 -0
- package/dist/src/routes/agent-activity.js.map +1 -0
- package/dist/src/routes/agent-capabilities.d.ts +17 -0
- package/dist/src/routes/agent-capabilities.d.ts.map +1 -0
- package/dist/src/routes/agent-capabilities.js +106 -0
- package/dist/src/routes/agent-capabilities.js.map +1 -0
- package/dist/src/routes/agent-directives.d.ts +17 -0
- package/dist/src/routes/agent-directives.d.ts.map +1 -0
- package/dist/src/routes/agent-directives.js +206 -0
- package/dist/src/routes/agent-directives.js.map +1 -0
- package/dist/src/routes/agent-integration.d.ts +17 -0
- package/dist/src/routes/agent-integration.d.ts.map +1 -0
- package/dist/src/routes/agent-integration.js +169 -0
- package/dist/src/routes/agent-integration.js.map +1 -0
- package/dist/src/routes/agent-messages.d.ts +17 -0
- package/dist/src/routes/agent-messages.d.ts.map +1 -0
- package/dist/src/routes/agent-messages.js +168 -0
- package/dist/src/routes/agent-messages.js.map +1 -0
- package/dist/src/routes/agent-tasks.d.ts +24 -0
- package/dist/src/routes/agent-tasks.d.ts.map +1 -0
- package/dist/src/routes/agent-tasks.js +425 -0
- package/dist/src/routes/agent-tasks.js.map +1 -0
- package/dist/src/routes/agents.js +2 -2
- package/dist/src/routes/agents.js.map +1 -1
- package/dist/src/routes/apps.d.ts.map +1 -1
- package/dist/src/routes/apps.js +5 -1
- package/dist/src/routes/apps.js.map +1 -1
- package/dist/src/routes/auth.d.ts.map +1 -1
- package/dist/src/routes/auth.js +19 -1
- package/dist/src/routes/auth.js.map +1 -1
- package/dist/src/routes/boards.js +2 -2
- package/dist/src/routes/boards.js.map +1 -1
- package/dist/src/routes/capabilities.js +4 -4
- package/dist/src/routes/capabilities.js.map +1 -1
- package/dist/src/routes/consent.d.ts.map +1 -1
- package/dist/src/routes/consent.js +2 -1
- package/dist/src/routes/consent.js.map +1 -1
- package/dist/src/routes/cortex.d.ts.map +1 -1
- package/dist/src/routes/cortex.js +1 -2
- package/dist/src/routes/cortex.js.map +1 -1
- package/dist/src/routes/disputes.js +4 -4
- package/dist/src/routes/disputes.js.map +1 -1
- package/dist/src/routes/extensions.d.ts.map +1 -1
- package/dist/src/routes/extensions.js +73 -23
- package/dist/src/routes/extensions.js.map +1 -1
- package/dist/src/routes/federation-auth.d.ts.map +1 -1
- package/dist/src/routes/federation-auth.js +2 -62
- package/dist/src/routes/federation-auth.js.map +1 -1
- package/dist/src/routes/federation-peer.d.ts.map +1 -1
- package/dist/src/routes/federation-peer.js +13 -1
- package/dist/src/routes/federation-peer.js.map +1 -1
- package/dist/src/routes/flags.d.ts.map +1 -1
- package/dist/src/routes/flags.js +2 -1
- package/dist/src/routes/flags.js.map +1 -1
- package/dist/src/routes/foundry.d.ts.map +1 -1
- package/dist/src/routes/foundry.js +2 -2
- package/dist/src/routes/foundry.js.map +1 -1
- package/dist/src/routes/generator.d.ts.map +1 -1
- package/dist/src/routes/generator.js +35 -7
- package/dist/src/routes/generator.js.map +1 -1
- package/dist/src/routes/ghii.d.ts.map +1 -1
- package/dist/src/routes/ghii.js +67 -31
- package/dist/src/routes/ghii.js.map +1 -1
- package/dist/src/routes/knowledge.d.ts.map +1 -1
- package/dist/src/routes/knowledge.js +4 -3
- package/dist/src/routes/knowledge.js.map +1 -1
- package/dist/src/routes/memory.d.ts.map +1 -1
- package/dist/src/routes/memory.js +10 -4
- package/dist/src/routes/memory.js.map +1 -1
- package/dist/src/routes/owners.d.ts.map +1 -1
- package/dist/src/routes/owners.js +104 -8
- package/dist/src/routes/owners.js.map +1 -1
- package/dist/src/routes/packages.js +1 -1
- package/dist/src/routes/packages.js.map +1 -1
- package/dist/src/routes/permissions.js +1 -1
- package/dist/src/routes/permissions.js.map +1 -1
- package/dist/src/routes/prompts.d.ts +9 -0
- package/dist/src/routes/prompts.d.ts.map +1 -1
- package/dist/src/routes/prompts.js +57 -1
- package/dist/src/routes/prompts.js.map +1 -1
- package/dist/src/routes/sharing-groups.d.ts +20 -0
- package/dist/src/routes/sharing-groups.d.ts.map +1 -0
- package/dist/src/routes/sharing-groups.js +297 -0
- package/dist/src/routes/sharing-groups.js.map +1 -0
- package/dist/src/routes/stats.d.ts +14 -0
- package/dist/src/routes/stats.d.ts.map +1 -1
- package/dist/src/routes/stats.js +79 -4
- package/dist/src/routes/stats.js.map +1 -1
- package/dist/src/routes/storage-files.d.ts.map +1 -1
- package/dist/src/routes/storage-files.js +8 -1
- package/dist/src/routes/storage-files.js.map +1 -1
- package/dist/src/routes/upload.js +2 -2
- package/dist/src/routes/upload.js.map +1 -1
- package/dist/src/routes/wallet.d.ts.map +1 -1
- package/dist/src/routes/wallet.js +2 -1
- package/dist/src/routes/wallet.js.map +1 -1
- package/dist/src/routes/work.d.ts.map +1 -1
- package/dist/src/routes/work.js +5 -1
- package/dist/src/routes/work.js.map +1 -1
- package/dist/src/schemas/knowledge-package.js +1 -1
- package/dist/src/schemas/knowledge-package.js.map +1 -1
- package/dist/src/server-bootstrap/routes-loader.d.ts +1 -1
- package/dist/src/server-bootstrap/routes-loader.d.ts.map +1 -1
- package/dist/src/server-bootstrap/routes-loader.js +24 -4
- package/dist/src/server-bootstrap/routes-loader.js.map +1 -1
- package/dist/src/server-bootstrap/service-init.d.ts.map +1 -1
- package/dist/src/server-bootstrap/service-init.js +2 -0
- package/dist/src/server-bootstrap/service-init.js.map +1 -1
- package/dist/src/server-bootstrap/static-files.d.ts.map +1 -1
- package/dist/src/server-bootstrap/static-files.js +10 -7
- package/dist/src/server-bootstrap/static-files.js.map +1 -1
- package/dist/src/server.d.ts.map +1 -1
- package/dist/src/server.js +4 -2
- package/dist/src/server.js.map +1 -1
- package/dist/src/services/activity-recorder.d.ts +16 -0
- package/dist/src/services/activity-recorder.d.ts.map +1 -0
- package/dist/src/services/activity-recorder.js +59 -0
- package/dist/src/services/activity-recorder.js.map +1 -0
- package/dist/src/services/capability-invoke.d.ts.map +1 -1
- package/dist/src/services/capability-invoke.js +5 -18
- package/dist/src/services/capability-invoke.js.map +1 -1
- package/dist/src/services/config-schema.d.ts.map +1 -1
- package/dist/src/services/config-schema.js +18 -0
- package/dist/src/services/config-schema.js.map +1 -1
- package/dist/src/services/consent.d.ts +1 -1
- package/dist/src/services/consent.d.ts.map +1 -1
- package/dist/src/services/consent.js +29 -11
- package/dist/src/services/consent.js.map +1 -1
- package/dist/src/services/core-jobs.d.ts.map +1 -1
- package/dist/src/services/core-jobs.js +5 -0
- package/dist/src/services/core-jobs.js.map +1 -1
- package/dist/src/services/directory.d.ts.map +1 -1
- package/dist/src/services/directory.js +10 -4
- package/dist/src/services/directory.js.map +1 -1
- package/dist/src/services/email.d.ts +17 -4
- package/dist/src/services/email.d.ts.map +1 -1
- package/dist/src/services/email.js +30 -12
- package/dist/src/services/email.js.map +1 -1
- package/dist/src/services/extension-runtime.d.ts.map +1 -1
- package/dist/src/services/extension-runtime.js +5 -0
- package/dist/src/services/extension-runtime.js.map +1 -1
- package/dist/src/services/federation.d.ts +2 -0
- package/dist/src/services/federation.d.ts.map +1 -1
- package/dist/src/services/federation.js.map +1 -1
- package/dist/src/services/job-seeding.d.ts.map +1 -1
- package/dist/src/services/job-seeding.js +2 -0
- package/dist/src/services/job-seeding.js.map +1 -1
- package/dist/src/services/mailbox-notification.d.ts +17 -0
- package/dist/src/services/mailbox-notification.d.ts.map +1 -1
- package/dist/src/services/mailbox-notification.js +25 -0
- package/dist/src/services/mailbox-notification.js.map +1 -1
- package/dist/src/services/morsel.d.ts.map +1 -1
- package/dist/src/services/morsel.js +10 -9
- package/dist/src/services/morsel.js.map +1 -1
- package/dist/src/services/password.d.ts +1 -6
- package/dist/src/services/password.d.ts.map +1 -1
- package/dist/src/services/password.js +19 -10
- package/dist/src/services/password.js.map +1 -1
- package/dist/src/services/push.d.ts +16 -0
- package/dist/src/services/push.d.ts.map +1 -1
- package/dist/src/services/push.js +20 -0
- package/dist/src/services/push.js.map +1 -1
- package/dist/src/services/quota.d.ts.map +1 -1
- package/dist/src/services/quota.js +2 -1
- package/dist/src/services/quota.js.map +1 -1
- package/dist/src/services/scheduler.d.ts.map +1 -1
- package/dist/src/services/scheduler.js +17 -1
- package/dist/src/services/scheduler.js.map +1 -1
- package/dist/src/services/stats.d.ts +43 -2
- package/dist/src/services/stats.d.ts.map +1 -1
- package/dist/src/services/stats.js +177 -1
- package/dist/src/services/stats.js.map +1 -1
- package/dist/src/services/task-stall-detector.d.ts +10 -0
- package/dist/src/services/task-stall-detector.d.ts.map +1 -0
- package/dist/src/services/task-stall-detector.js +38 -0
- package/dist/src/services/task-stall-detector.js.map +1 -0
- package/dist/src/services/totp.js +2 -2
- package/dist/src/services/work-task-bridge.d.ts +10 -0
- package/dist/src/services/work-task-bridge.d.ts.map +1 -0
- package/dist/src/services/work-task-bridge.js +53 -0
- package/dist/src/services/work-task-bridge.js.map +1 -0
- package/dist/src/storage/interface.d.ts +175 -5
- package/dist/src/storage/interface.d.ts.map +1 -1
- package/dist/src/storage/providers/mongodb/index.d.ts +105 -2
- package/dist/src/storage/providers/mongodb/index.d.ts.map +1 -1
- package/dist/src/storage/providers/mongodb/index.js +738 -8
- package/dist/src/storage/providers/mongodb/index.js.map +1 -1
- package/dist/src/storage/providers/sqlite/index.d.ts +83 -1
- package/dist/src/storage/providers/sqlite/index.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/index.js +204 -5
- package/dist/src/storage/providers/sqlite/index.js.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/agent-activity.d.ts +14 -0
- package/dist/src/storage/providers/sqlite/repos/agent-activity.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/agent-activity.js +44 -0
- package/dist/src/storage/providers/sqlite/repos/agent-activity.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/agent-directives.d.ts +14 -0
- package/dist/src/storage/providers/sqlite/repos/agent-directives.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/agent-directives.js +65 -0
- package/dist/src/storage/providers/sqlite/repos/agent-directives.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/agent-message.d.ts +28 -0
- package/dist/src/storage/providers/sqlite/repos/agent-message.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/agent-message.js +93 -0
- package/dist/src/storage/providers/sqlite/repos/agent-message.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/agent-task.d.ts +45 -0
- package/dist/src/storage/providers/sqlite/repos/agent-task.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/agent-task.js +155 -0
- package/dist/src/storage/providers/sqlite/repos/agent-task.js.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/consent.d.ts +1 -0
- package/dist/src/storage/providers/sqlite/repos/consent.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/consent.js +4 -0
- package/dist/src/storage/providers/sqlite/repos/consent.js.map +1 -1
- package/dist/src/storage/providers/sqlite/repos/sharing-group.d.ts +16 -0
- package/dist/src/storage/providers/sqlite/repos/sharing-group.d.ts.map +1 -0
- package/dist/src/storage/providers/sqlite/repos/sharing-group.js +68 -0
- package/dist/src/storage/providers/sqlite/repos/sharing-group.js.map +1 -0
- package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.js +121 -0
- package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
- package/dist/src/storage/repositories/agent-activity.repository.d.ts +15 -0
- package/dist/src/storage/repositories/agent-activity.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/agent-activity.repository.js +8 -0
- package/dist/src/storage/repositories/agent-activity.repository.js.map +1 -0
- package/dist/src/storage/repositories/agent-directives.repository.d.ts +15 -0
- package/dist/src/storage/repositories/agent-directives.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/agent-directives.repository.js +8 -0
- package/dist/src/storage/repositories/agent-directives.repository.js.map +1 -0
- package/dist/src/storage/repositories/agent-message.repository.d.ts +29 -0
- package/dist/src/storage/repositories/agent-message.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/agent-message.repository.js +8 -0
- package/dist/src/storage/repositories/agent-message.repository.js.map +1 -0
- package/dist/src/storage/repositories/agent-task.repository.d.ts +46 -0
- package/dist/src/storage/repositories/agent-task.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/agent-task.repository.js +8 -0
- package/dist/src/storage/repositories/agent-task.repository.js.map +1 -0
- package/dist/src/storage/repositories/consent.repository.d.ts +1 -0
- package/dist/src/storage/repositories/consent.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/device-auth.repository.d.ts +1 -0
- package/dist/src/storage/repositories/device-auth.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/extension-instance.repository.d.ts +1 -0
- package/dist/src/storage/repositories/extension-instance.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/index.d.ts +6 -0
- package/dist/src/storage/repositories/index.d.ts.map +1 -1
- package/dist/src/storage/repositories/knowledge.repository.d.ts +2 -0
- package/dist/src/storage/repositories/knowledge.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/moderation.repository.d.ts +1 -0
- package/dist/src/storage/repositories/moderation.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/sharing-group.repository.d.ts +17 -0
- package/dist/src/storage/repositories/sharing-group.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/sharing-group.repository.js +8 -0
- package/dist/src/storage/repositories/sharing-group.repository.js.map +1 -0
- package/dist/src/storage/repositories/stats.repository.d.ts +12 -0
- package/dist/src/storage/repositories/stats.repository.d.ts.map +1 -0
- package/dist/src/storage/repositories/stats.repository.js +7 -0
- package/dist/src/storage/repositories/stats.repository.js.map +1 -0
- package/dist/src/storage/storage-factory.js +1 -0
- package/dist/src/storage/storage-factory.js.map +1 -1
- package/dist/src/utils/password-validation.d.ts +8 -0
- package/dist/src/utils/password-validation.d.ts.map +1 -0
- package/dist/src/utils/password-validation.js +25 -0
- package/dist/src/utils/password-validation.js.map +1 -0
- package/dist/src/utils/service-summary.d.ts +6 -1
- package/dist/src/utils/service-summary.d.ts.map +1 -1
- package/dist/src/utils/service-summary.js +6 -1
- package/dist/src/utils/service-summary.js.map +1 -1
- package/package.json +97 -77
- package/prisma/schema.prisma +128 -10
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file agent-messages.js
|
|
3
|
+
* @description Frontend API service for agent messages.
|
|
4
|
+
* Provides send, list, thread listing, and status update operations.
|
|
5
|
+
* @version-history
|
|
6
|
+
* v1.0.0 -- 2026-05-22 -- Initial creation for Agent Dashboard Phase 3
|
|
7
|
+
*/
|
|
8
|
+
import { apiGet, apiPost, apiPatch } from '/js/api.js';
|
|
9
|
+
|
|
10
|
+
export async function sendMessage(agentName, content, threadId) {
|
|
11
|
+
return apiPost(`/v1/agents/${encodeURIComponent(agentName)}/messages`, {
|
|
12
|
+
content,
|
|
13
|
+
direction: 'inbound',
|
|
14
|
+
...(threadId && { thread_id: threadId }),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function listMessages(agentName, opts = {}) {
|
|
19
|
+
const params = new URLSearchParams();
|
|
20
|
+
if (opts.page) params.set('page', String(opts.page));
|
|
21
|
+
if (opts.perPage) params.set('per_page', String(opts.perPage));
|
|
22
|
+
if (opts.direction) params.set('direction', opts.direction);
|
|
23
|
+
if (opts.threadId) params.set('thread_id', opts.threadId);
|
|
24
|
+
const qs = params.toString();
|
|
25
|
+
return apiGet(`/v1/agents/${encodeURIComponent(agentName)}/messages${qs ? '?' + qs : ''}`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function listThreads(agentName) {
|
|
29
|
+
return apiGet(`/v1/agents/${encodeURIComponent(agentName)}/messages/threads`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export async function updateMessageStatus(agentName, messageId, status) {
|
|
33
|
+
return apiPatch(`/v1/agents/${encodeURIComponent(agentName)}/messages/${messageId}`, { status });
|
|
34
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file agent-services.js
|
|
3
|
+
* @description Frontend API service for agent published services (actions).
|
|
4
|
+
* Fetches actions from the work exchange and filters by agent name.
|
|
5
|
+
* @version-history
|
|
6
|
+
* v1.0.0 -- 2026-05-22 -- Initial creation for Agent Dashboard Phase 3
|
|
7
|
+
*/
|
|
8
|
+
import { apiGet } from '/js/api.js';
|
|
9
|
+
|
|
10
|
+
export async function getAgentServices(agentName) {
|
|
11
|
+
const res = await apiGet('/v1/actions');
|
|
12
|
+
if (!res.ok) return { ok: false, actions: [] };
|
|
13
|
+
const actions = (res.data?.actions || []).filter(a =>
|
|
14
|
+
a.provider_gaii?.includes(`${agentName}#`) || a.provider_gaii?.includes(agentName)
|
|
15
|
+
);
|
|
16
|
+
return { ok: true, actions };
|
|
17
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file agent-tasks.js
|
|
3
|
+
* @description Frontend API service for agent task operations.
|
|
4
|
+
* Provides CRUD, lifecycle (start/complete/fail), and event log access
|
|
5
|
+
* for the agent task queue system.
|
|
6
|
+
* @version-history
|
|
7
|
+
* v1.0.0 -- 2026-05-21 -- Initial creation for Agent Dashboard Phase 1
|
|
8
|
+
*/
|
|
9
|
+
import { apiGet, apiPost, apiDelete } from '/js/api.js';
|
|
10
|
+
|
|
11
|
+
export async function listTasks(agentName, opts = {}) {
|
|
12
|
+
const params = new URLSearchParams();
|
|
13
|
+
if (opts.status) params.set('status', opts.status);
|
|
14
|
+
if (opts.page) params.set('page', String(opts.page));
|
|
15
|
+
if (opts.per_page) params.set('per_page', String(opts.per_page));
|
|
16
|
+
const qs = params.toString();
|
|
17
|
+
return apiGet(`/v1/agents/${encodeURIComponent(agentName)}/tasks${qs ? '?' + qs : ''}`);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export async function getTask(agentName, taskId) {
|
|
21
|
+
return apiGet(`/v1/agents/${encodeURIComponent(agentName)}/tasks/${encodeURIComponent(taskId)}`);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function createTask(agentName, data) {
|
|
25
|
+
return apiPost(`/v1/agents/${encodeURIComponent(agentName)}/tasks`, data);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export async function startTask(agentName, taskId) {
|
|
29
|
+
return apiPost(`/v1/agents/${encodeURIComponent(agentName)}/tasks/${encodeURIComponent(taskId)}/start`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export async function completeTask(agentName, taskId, data = {}) {
|
|
33
|
+
return apiPost(`/v1/agents/${encodeURIComponent(agentName)}/tasks/${encodeURIComponent(taskId)}/complete`, data);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export async function failTask(agentName, taskId, reason) {
|
|
37
|
+
return apiPost(`/v1/agents/${encodeURIComponent(agentName)}/tasks/${encodeURIComponent(taskId)}/fail`, { reason });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export async function deleteTask(agentName, taskId) {
|
|
41
|
+
return apiDelete(`/v1/agents/${encodeURIComponent(agentName)}/tasks/${encodeURIComponent(taskId)}`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export async function listEvents(agentName, taskId) {
|
|
45
|
+
return apiGet(`/v1/agents/${encodeURIComponent(agentName)}/tasks/${encodeURIComponent(taskId)}/events`);
|
|
46
|
+
}
|
|
@@ -22,9 +22,10 @@ export async function searchMemory(query, agentGaii) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/** Create a new memory entry. */
|
|
25
|
-
export async function createMemory(key, value, visibility, tags) {
|
|
25
|
+
export async function createMemory(key, value, visibility, tags, groupId) {
|
|
26
26
|
const body = { key, value, visibility: visibility || 'private' };
|
|
27
27
|
if (tags) body.tags = Array.isArray(tags) ? tags : tags.split(',').map(t => t.trim()).filter(Boolean);
|
|
28
|
+
if (visibility === 'group' && groupId) body.group_id = groupId;
|
|
28
29
|
return api('/v1/memory', {
|
|
29
30
|
method: 'POST',
|
|
30
31
|
body: JSON.stringify(body),
|
|
@@ -48,10 +49,12 @@ export async function updateMemoryFull(key, fields) {
|
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
/** Update visibility on a memory entry. */
|
|
51
|
-
export async function updateMemoryVisibility(key, visibility, version) {
|
|
52
|
+
export async function updateMemoryVisibility(key, visibility, version, groupId) {
|
|
53
|
+
const body = { visibility, version };
|
|
54
|
+
if (visibility === 'group' && groupId) body.group_id = groupId;
|
|
52
55
|
return api(`/v1/memory/${encodeURIComponent(key)}`, {
|
|
53
56
|
method: 'PUT',
|
|
54
|
-
body: JSON.stringify(
|
|
57
|
+
body: JSON.stringify(body),
|
|
55
58
|
});
|
|
56
59
|
}
|
|
57
60
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file sharing-groups.js
|
|
3
|
+
* @description Frontend API service for sharing group operations.
|
|
4
|
+
* Provides list/get/create/update/delete for groups and add/update/remove for members.
|
|
5
|
+
* @structure
|
|
6
|
+
* - listGroups() -- GET /v1/groups
|
|
7
|
+
* - getGroup(id) -- GET /v1/groups/:id
|
|
8
|
+
* - createGroup() -- POST /v1/groups
|
|
9
|
+
* - updateGroup() -- PATCH /v1/groups/:id
|
|
10
|
+
* - deleteGroup() -- DELETE /v1/groups/:id
|
|
11
|
+
* - addMember() -- POST /v1/groups/:id/members
|
|
12
|
+
* - updateMember() -- PATCH /v1/groups/:id/members/:identifier
|
|
13
|
+
* - removeMember() -- DELETE /v1/groups/:id/members/:identifier
|
|
14
|
+
* @usage
|
|
15
|
+
* import { listGroups, createGroup } from '/js/services/sharing-groups.js';
|
|
16
|
+
* @version-history
|
|
17
|
+
* v1.0.0 -- 2026-05-21 -- Initial creation for Agent Dashboard Phase 1
|
|
18
|
+
*/
|
|
19
|
+
import { apiGet, apiPost, apiPatch, apiDelete } from '/js/api.js';
|
|
20
|
+
|
|
21
|
+
export async function listGroups() {
|
|
22
|
+
return apiGet('/v1/groups');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export async function getGroup(groupId) {
|
|
26
|
+
return apiGet(`/v1/groups/${encodeURIComponent(groupId)}`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function createGroup(data) {
|
|
30
|
+
return apiPost('/v1/groups', data);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export async function updateGroup(groupId, data) {
|
|
34
|
+
return apiPatch(`/v1/groups/${encodeURIComponent(groupId)}`, data);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export async function deleteGroup(groupId) {
|
|
38
|
+
return apiDelete(`/v1/groups/${encodeURIComponent(groupId)}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function addMember(groupId, data) {
|
|
42
|
+
return apiPost(`/v1/groups/${encodeURIComponent(groupId)}/members`, data);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export async function updateMember(groupId, identifier, data) {
|
|
46
|
+
return apiPatch(`/v1/groups/${encodeURIComponent(groupId)}/members/${encodeURIComponent(identifier)}`, data);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export async function removeMember(groupId, identifier) {
|
|
50
|
+
return apiDelete(`/v1/groups/${encodeURIComponent(groupId)}/members/${encodeURIComponent(identifier)}`);
|
|
51
|
+
}
|
package/dist/public/spa.html
CHANGED
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
<link rel="stylesheet" href="/css/components/tags.css">
|
|
65
65
|
<link rel="stylesheet" href="/css/views/help.css">
|
|
66
66
|
<link rel="stylesheet" href="/css/views/capabilities.css">
|
|
67
|
+
<link rel="stylesheet" href="/css/views/agents-detail.css">
|
|
67
68
|
<link rel="stylesheet" href="/css/views/admin.css">
|
|
68
69
|
<script type="importmap">
|
|
69
70
|
{
|
|
@@ -140,7 +141,20 @@
|
|
|
140
141
|
"/components/useViewCSS.js": "/components/useViewCSS.js",
|
|
141
142
|
"/lib/live-updates.js": "/lib/live-updates.js",
|
|
142
143
|
"/lib/minidenticons.min.js": "/lib/minidenticons.min.js",
|
|
143
|
-
"/lib/yaml.mjs": "/lib/yaml.mjs"
|
|
144
|
+
"/lib/yaml.mjs": "/lib/yaml.mjs",
|
|
145
|
+
"/views/profile/agents-tasks-subtab.js": "/views/profile/agents-tasks-subtab.js",
|
|
146
|
+
"/views/profile/agents-directives-subtab.js": "/views/profile/agents-directives-subtab.js",
|
|
147
|
+
"/js/services/agent-tasks.js": "/js/services/agent-tasks.js",
|
|
148
|
+
"/js/services/agent-directives.js": "/js/services/agent-directives.js",
|
|
149
|
+
"/js/services/agent-capabilities.js": "/js/services/agent-capabilities.js",
|
|
150
|
+
"/views/profile/agents-capabilities-subtab.js": "/views/profile/agents-capabilities-subtab.js",
|
|
151
|
+
"/js/services/sharing-groups.js": "/js/services/sharing-groups.js",
|
|
152
|
+
"/js/services/agent-activity.js": "/js/services/agent-activity.js",
|
|
153
|
+
"/views/profile/agents-activity-subtab.js": "/views/profile/agents-activity-subtab.js",
|
|
154
|
+
"/views/profile/agents-services-subtab.js": "/views/profile/agents-services-subtab.js",
|
|
155
|
+
"/views/profile/agents-messages-subtab.js": "/views/profile/agents-messages-subtab.js",
|
|
156
|
+
"/js/services/agent-services.js": "/js/services/agent-services.js",
|
|
157
|
+
"/js/services/agent-messages.js": "/js/services/agent-messages.js"
|
|
144
158
|
}
|
|
145
159
|
}
|
|
146
160
|
</script>
|
|
@@ -377,9 +391,14 @@
|
|
|
377
391
|
<a href="/v1/help" onClick=${(e) => handleNav(e, '/v1/help')} class="${currentPath === '/v1/help' ? 'active' : ''}">${t('nav.help')}</a>
|
|
378
392
|
${session && html`
|
|
379
393
|
<a href="/app-catalog.html" target="_blank" class="${currentPath === '/app-catalog.html' ? 'active' : ''}">${t('nav.apps') || 'Apps'}</a>
|
|
380
|
-
<a href="/v1/profile" class="profile-link visible" onClick=${(e) => handleNav(e, '/v1/profile')}>
|
|
394
|
+
<a href="/v1/profile" class="profile-link visible ${currentPath === '/v1/profile' ? 'active' : ''}" onClick=${(e) => handleNav(e, '/v1/profile')}>
|
|
381
395
|
${t('nav.profile')}
|
|
382
396
|
</a>
|
|
397
|
+
${session.roles && session.roles.includes('operator') && html`
|
|
398
|
+
<a href="/v1/admin" class="${currentPath === '/v1/admin' ? 'active' : ''}" onClick=${(e) => handleNav(e, '/v1/admin')}>
|
|
399
|
+
${t('nav.admin')}
|
|
400
|
+
</a>
|
|
401
|
+
`}
|
|
383
402
|
`}
|
|
384
403
|
<div class="topnav-center">
|
|
385
404
|
<button class="lang-btn ${locale === 'en' ? 'active' : ''}" onClick=${() => handleLangSwitch('en')}>EN</button>
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file agent-tasks-tab.js
|
|
3
|
+
* @description Admin dashboard tab for browsing all agent tasks across all owners.
|
|
4
|
+
* Provides status filtering, pagination, and TODO progress display.
|
|
5
|
+
* @version-history
|
|
6
|
+
* v1.0.0 -- 2026-05-21 -- Initial creation for Agent Dashboard Phase 1
|
|
7
|
+
*/
|
|
8
|
+
import { h } from 'preact';
|
|
9
|
+
import { useState, useEffect, useCallback } from 'preact/hooks';
|
|
10
|
+
import htm from 'htm';
|
|
11
|
+
const html = htm.bind(h);
|
|
12
|
+
import { t } from '/js/i18n.js';
|
|
13
|
+
import { escHtml } from '/js/utils.js';
|
|
14
|
+
import { num, dt, Empty, Badge } from './shared.js';
|
|
15
|
+
import { apiGet } from '/js/api.js';
|
|
16
|
+
|
|
17
|
+
const PAGE_SIZE = 20;
|
|
18
|
+
|
|
19
|
+
const STATUSES = ['', 'draft', 'queued', 'active', 'stalled', 'done', 'failed'];
|
|
20
|
+
|
|
21
|
+
export default function AgentTasksTab({ data, reload, session }) {
|
|
22
|
+
const [tasks, setTasks] = useState([]);
|
|
23
|
+
const [total, setTotal] = useState(0);
|
|
24
|
+
const [page, setPage] = useState(1);
|
|
25
|
+
const [loading, setLoading] = useState(false);
|
|
26
|
+
const [statusFilter, setStatusFilter] = useState('');
|
|
27
|
+
|
|
28
|
+
const loadTasks = useCallback(async (p = 1) => {
|
|
29
|
+
setLoading(true);
|
|
30
|
+
try {
|
|
31
|
+
const params = new URLSearchParams();
|
|
32
|
+
params.set('page', String(p));
|
|
33
|
+
params.set('per_page', String(PAGE_SIZE));
|
|
34
|
+
if (statusFilter) params.set('status', statusFilter);
|
|
35
|
+
const r = await apiGet('/v1/admin/agent-tasks?' + params.toString());
|
|
36
|
+
if (r.data) {
|
|
37
|
+
setTasks(r.data.tasks || []);
|
|
38
|
+
setTotal(r.data.total || 0);
|
|
39
|
+
setPage(p);
|
|
40
|
+
}
|
|
41
|
+
} catch (e) {
|
|
42
|
+
console.warn('Failed to load agent tasks:', e.message);
|
|
43
|
+
}
|
|
44
|
+
setLoading(false);
|
|
45
|
+
}, [statusFilter]);
|
|
46
|
+
|
|
47
|
+
useEffect(() => { loadTasks(1); }, [loadTasks]);
|
|
48
|
+
|
|
49
|
+
// Listen for live updates
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const handler = () => { loadTasks(page); };
|
|
52
|
+
window.addEventListener('aimeat-live-update', handler);
|
|
53
|
+
return () => window.removeEventListener('aimeat-live-update', handler);
|
|
54
|
+
}, [loadTasks, page]);
|
|
55
|
+
|
|
56
|
+
function handleFilterChange(e) {
|
|
57
|
+
setStatusFilter(e.target.value);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function statusColor(status) {
|
|
61
|
+
switch (status) {
|
|
62
|
+
case 'active': return 'var(--accent, #06b6d4)';
|
|
63
|
+
case 'done': return '#22c55e';
|
|
64
|
+
case 'failed': return '#ef4444';
|
|
65
|
+
case 'stalled': return '#eab308';
|
|
66
|
+
case 'queued': return '#a855f7';
|
|
67
|
+
case 'draft': return 'var(--text-dim)';
|
|
68
|
+
default: return 'var(--text-dim)';
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const totalPages = Math.ceil(total / PAGE_SIZE);
|
|
73
|
+
|
|
74
|
+
return html`
|
|
75
|
+
<div>
|
|
76
|
+
<!-- Filter bar -->
|
|
77
|
+
<div class="adm-mem-filters">
|
|
78
|
+
<select class="adm-input" value=${statusFilter} onChange=${handleFilterChange}>
|
|
79
|
+
<option value="">${t('dashboard.agentTasksStatus')} (${t('dashboard.all') || 'All'})</option>
|
|
80
|
+
${STATUSES.filter(s => s).map(s => html`
|
|
81
|
+
<option value=${s}>${s}</option>
|
|
82
|
+
`)}
|
|
83
|
+
</select>
|
|
84
|
+
<button class="adm-btn" onClick=${() => loadTasks(1)} disabled=${loading}>
|
|
85
|
+
${loading ? t('dashboard.loading') : t('dashboard.refresh')}
|
|
86
|
+
</button>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<!-- Stats summary -->
|
|
90
|
+
<div class="adm-mem-stats">
|
|
91
|
+
<div class="adm-mem-stat">
|
|
92
|
+
<span class="adm-mem-stat-value">${num(total)}</span>
|
|
93
|
+
<span class="adm-mem-stat-label">${t('dashboard.agentTasksTotal')}</span>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
<!-- Table -->
|
|
98
|
+
${tasks.length === 0 && !loading && html`<${Empty} text=${t('dashboard.agentTasksEmpty')} />`}
|
|
99
|
+
|
|
100
|
+
${tasks.length > 0 && html`
|
|
101
|
+
<div class="adm-card">
|
|
102
|
+
<div class="scrollable">
|
|
103
|
+
<table>
|
|
104
|
+
<thead><tr>
|
|
105
|
+
<th>${t('dashboard.agentTasksAgent')}</th>
|
|
106
|
+
<th>${t('dashboard.agentTasksTitle')}</th>
|
|
107
|
+
<th>${t('dashboard.agentTasksStatus')}</th>
|
|
108
|
+
<th>${t('dashboard.agentTasksTodoProgress')}</th>
|
|
109
|
+
<th>${t('dashboard.agentTasksCreated')}</th>
|
|
110
|
+
<th>${t('dashboard.agentTasksLastEvent')}</th>
|
|
111
|
+
</tr></thead>
|
|
112
|
+
<tbody>
|
|
113
|
+
${tasks.map(task => html`
|
|
114
|
+
<tr>
|
|
115
|
+
<td class="mono" style="font-size:.8rem">${escHtml(task.agent_gaii)}</td>
|
|
116
|
+
<td>${escHtml(task.title)}</td>
|
|
117
|
+
<td>
|
|
118
|
+
<span class="tag" style="color:${statusColor(task.status)};border-color:${statusColor(task.status)}">
|
|
119
|
+
${task.status}
|
|
120
|
+
</span>
|
|
121
|
+
</td>
|
|
122
|
+
<td>
|
|
123
|
+
${task.todo_progress.total > 0
|
|
124
|
+
? html`${task.todo_progress.done}/${task.todo_progress.total}`
|
|
125
|
+
: html`<span style="color:var(--text-dim)">--</span>`
|
|
126
|
+
}
|
|
127
|
+
</td>
|
|
128
|
+
<td style="color:var(--text-dim)">${dt(task.created_at)}</td>
|
|
129
|
+
<td style="color:var(--text-dim)">${dt(task.last_event_at)}</td>
|
|
130
|
+
</tr>
|
|
131
|
+
`)}
|
|
132
|
+
</tbody>
|
|
133
|
+
</table>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<!-- Pagination -->
|
|
137
|
+
${totalPages > 1 && html`
|
|
138
|
+
<div class="adm-mem-pagination">
|
|
139
|
+
<button class="adm-btn-sm"
|
|
140
|
+
disabled=${page <= 1}
|
|
141
|
+
onClick=${() => loadTasks(page - 1)}>
|
|
142
|
+
← ${t('dashboard.prev') || 'Prev'}
|
|
143
|
+
</button>
|
|
144
|
+
<span class="adm-mem-page-info">${page} / ${totalPages}</span>
|
|
145
|
+
<button class="adm-btn-sm"
|
|
146
|
+
disabled=${page >= totalPages}
|
|
147
|
+
onClick=${() => loadTasks(page + 1)}>
|
|
148
|
+
${t('dashboard.next') || 'Next'} →
|
|
149
|
+
</button>
|
|
150
|
+
</div>
|
|
151
|
+
`}
|
|
152
|
+
</div>
|
|
153
|
+
`}
|
|
154
|
+
</div>
|
|
155
|
+
`;
|
|
156
|
+
}
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
getFederationPeers, getFederationDirectory, approvePeeringRequest, rejectPeeringRequest,
|
|
10
10
|
deletePeeringRequest, activatePeer, addPeerDirect, removePeer, removePeerEmergency,
|
|
11
11
|
testFederationNode, joinGenesisNetwork, updatePeerPolicy, getNetworkDirectory,
|
|
12
|
+
getConfig, saveConfig,
|
|
12
13
|
} from '/js/services/admin.js';
|
|
13
14
|
import { useConfirm } from '/components/Modal.js';
|
|
14
15
|
|
|
@@ -30,6 +31,39 @@ export default function FederationTab({ data, reload }) {
|
|
|
30
31
|
const [joining, setJoining] = useState(false);
|
|
31
32
|
const [joinResult, setJoinResult] = useState(null);
|
|
32
33
|
|
|
34
|
+
// ── Federation Auth Policy state ──
|
|
35
|
+
const [authPolicy, setAuthPolicy] = useState('disabled');
|
|
36
|
+
const [defaultScopes, setDefaultScopes] = useState([]);
|
|
37
|
+
const [authPolicyLoading, setAuthPolicyLoading] = useState(true);
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
getConfig().then(res => {
|
|
41
|
+
if (res.ok && res.data?.config) {
|
|
42
|
+
const c = res.data.config;
|
|
43
|
+
setAuthPolicy(c.federation?.auth_policy ?? c.federationAuthPolicy ?? 'disabled');
|
|
44
|
+
const scopes = c.federation?.default_scopes ?? c.federationDefaultScopes ?? 'memory:read,catalogue:read';
|
|
45
|
+
setDefaultScopes(typeof scopes === 'string' ? scopes.split(',').filter(Boolean) : (scopes || []));
|
|
46
|
+
}
|
|
47
|
+
setAuthPolicyLoading(false);
|
|
48
|
+
});
|
|
49
|
+
}, []);
|
|
50
|
+
|
|
51
|
+
const doSaveAuthPolicy = async (policy, scopes) => {
|
|
52
|
+
const changes = [
|
|
53
|
+
{ path: 'federation.auth_policy', value: policy },
|
|
54
|
+
{ path: 'federation.default_scopes', value: Array.isArray(scopes) ? scopes.join(',') : scopes },
|
|
55
|
+
];
|
|
56
|
+
const res = await saveConfig(changes);
|
|
57
|
+
if (res.ok) { setActionSuccess(t('dashboard.fedPolicyUpdated')); setTimeout(() => setActionSuccess(null), 3000); }
|
|
58
|
+
else setActionError(res.error?.message || 'Failed to save');
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const toggleScope = (scope) => {
|
|
62
|
+
const next = defaultScopes.includes(scope) ? defaultScopes.filter(s => s !== scope) : [...defaultScopes, scope];
|
|
63
|
+
setDefaultScopes(next);
|
|
64
|
+
doSaveAuthPolicy(authPolicy, next);
|
|
65
|
+
};
|
|
66
|
+
|
|
33
67
|
// ── Network Directory state ──
|
|
34
68
|
const [dirEntries, setDirEntries] = useState([]);
|
|
35
69
|
const [dirSearch, setDirSearch] = useState('');
|
|
@@ -217,6 +251,31 @@ export default function FederationTab({ data, reload }) {
|
|
|
217
251
|
{ label: t('dashboard.fedPendingRequests'), value: pendingRequests.length, color: '#06b6d4' },
|
|
218
252
|
]} />
|
|
219
253
|
|
|
254
|
+
<!-- ═══ Federation Auth Policy ═══ -->
|
|
255
|
+
<div class="adm-card adm-mt-lg">
|
|
256
|
+
<h4 class="adm-mb-sm" style="margin:0">${t('dashboard.fedAuthPolicyTitle')}</h4>
|
|
257
|
+
<p class="adm-text-dim adm-text-base adm-mb-md" style="margin:0">${t('dashboard.fedAuthPolicyDesc')}</p>
|
|
258
|
+
${authPolicyLoading ? html`<p class="adm-text-dim">...</p>` : html`
|
|
259
|
+
<div style="display:flex;gap:12px;align-items:center;flex-wrap:wrap">
|
|
260
|
+
<select class="adm-input" style="max-width:240px" value=${authPolicy} onChange=${(e) => { setAuthPolicy(e.target.value); doSaveAuthPolicy(e.target.value, defaultScopes); }}>
|
|
261
|
+
<option value="disabled">${t('dashboard.fedAuthDisabled')}</option>
|
|
262
|
+
<option value="all_peers">${t('dashboard.fedAuthAllPeers')}</option>
|
|
263
|
+
<option value="specific_peers">${t('dashboard.fedAuthSpecificPeers')}</option>
|
|
264
|
+
</select>
|
|
265
|
+
</div>
|
|
266
|
+
${authPolicy !== 'disabled' && html`
|
|
267
|
+
<div class="adm-mt-md">
|
|
268
|
+
<p class="adm-text-sm adm-text-dim adm-mb-sm">${t('dashboard.fedDefaultScopes')}</p>
|
|
269
|
+
<div style="display:flex;gap:8px;flex-wrap:wrap">
|
|
270
|
+
${['memory:read','memory:write','catalogue:read','social:read','social:write','work:request','boards:read','boards:write'].map(s => html`
|
|
271
|
+
<label class="adm-text-sm"><input type="checkbox" checked=${defaultScopes.includes(s)} onChange=${() => toggleScope(s)} /> ${s}</label>
|
|
272
|
+
`)}
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
`}
|
|
276
|
+
`}
|
|
277
|
+
</div>
|
|
278
|
+
|
|
220
279
|
<!-- ═══ Network Directory ═══ -->
|
|
221
280
|
<div class="adm-card adm-mt-lg">
|
|
222
281
|
<h4 class="adm-mb-sm" style="margin:0">${t('dashboard.fedNetworkDirectoryTitle')}</h4>
|
|
@@ -313,6 +372,7 @@ export default function FederationTab({ data, reload }) {
|
|
|
313
372
|
<label class="adm-text-sm"><input type="checkbox" checked=${p.share_catalogue !== false} onChange=${(e) => doUpdatePolicy(p.node_id, 'share_catalogue', e.target.checked)} /> ${t('dashboard.fedShareCatalogue')}</label>
|
|
314
373
|
<label class="adm-text-sm"><input type="checkbox" checked=${p.replicate_memory !== false} onChange=${(e) => doUpdatePolicy(p.node_id, 'replicate_memory', e.target.checked)} /> ${t('dashboard.fedReplicateMemory')}</label>
|
|
315
374
|
<label class="adm-text-sm"><input type="checkbox" checked=${p.allow_routing !== false} onChange=${(e) => doUpdatePolicy(p.node_id, 'allow_routing', e.target.checked)} /> ${t('dashboard.fedAllowRouting')}</label>
|
|
375
|
+
<label class="adm-text-sm"><input type="checkbox" checked=${!!p.allow_federated_auth} onChange=${(e) => doUpdatePolicy(p.node_id, 'allow_federated_auth', e.target.checked)} /> ${t('dashboard.fedAllowAuth')}</label>
|
|
316
376
|
<select class="adm-input" style="font-size:.75rem;padding:2px 4px;margin-top:4px" value=${p.peer_mode || 'federation'} onChange=${(e) => doUpdatePolicy(p.node_id, 'peer_mode', e.target.value)}>
|
|
317
377
|
<option value="federation">${t('dashboard.fedPeerModeFederation')}</option>
|
|
318
378
|
<option value="private">${t('dashboard.fedPeerModePrivate')}</option>
|
|
@@ -141,6 +141,7 @@ export default function MemoryTab({ data, reload, session }) {
|
|
|
141
141
|
<option value="">${t('dashboard.memoryVisibility')} (${t('dashboard.all') || 'All'})</option>
|
|
142
142
|
<option value="private">private</option>
|
|
143
143
|
<option value="owner">owner</option>
|
|
144
|
+
<option value="group">group</option>
|
|
144
145
|
<option value="public">public</option>
|
|
145
146
|
</select>
|
|
146
147
|
<button type="submit" class="adm-btn" disabled=${loading}>
|
|
@@ -1,14 +1,37 @@
|
|
|
1
1
|
import { h } from 'preact';
|
|
2
|
+
import { useState, useEffect } from 'preact/hooks';
|
|
2
3
|
import htm from 'htm';
|
|
3
4
|
const html = htm.bind(h);
|
|
4
5
|
import { t } from '/js/i18n.js';
|
|
5
6
|
import { escHtml } from '/js/utils.js';
|
|
6
7
|
import { num, fmtUp, Badge, StatsGrid, EconRow, HealthRow } from './shared.js';
|
|
8
|
+
import { apiGet } from '/js/api.js';
|
|
7
9
|
|
|
8
10
|
export default function OverviewTab({ data }) {
|
|
9
11
|
const d = data.dash;
|
|
10
12
|
if (!d) return html`<div class="empty">${t('dashboard.loading')}</div>`;
|
|
11
13
|
|
|
14
|
+
const [activeTaskCount, setActiveTaskCount] = useState(null);
|
|
15
|
+
const [sharingGroupCount, setSharingGroupCount] = useState(null);
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
// Fetch active/queued agent task count
|
|
19
|
+
apiGet('/v1/admin/agent-tasks?status=active&per_page=1')
|
|
20
|
+
.then(r => {
|
|
21
|
+
const activeTotal = r.data?.total || 0;
|
|
22
|
+
// Also fetch queued
|
|
23
|
+
return apiGet('/v1/admin/agent-tasks?status=queued&per_page=1').then(r2 => {
|
|
24
|
+
setActiveTaskCount(activeTotal + (r2.data?.total || 0));
|
|
25
|
+
});
|
|
26
|
+
})
|
|
27
|
+
.catch(() => setActiveTaskCount(0));
|
|
28
|
+
|
|
29
|
+
// Fetch sharing group count
|
|
30
|
+
apiGet('/v1/admin/sharing-groups')
|
|
31
|
+
.then(r => setSharingGroupCount(r.data?.total || 0))
|
|
32
|
+
.catch(() => setSharingGroupCount(0));
|
|
33
|
+
}, []);
|
|
34
|
+
|
|
12
35
|
const h_ = d.health;
|
|
13
36
|
const c = d.counts;
|
|
14
37
|
const e = d.economy;
|
|
@@ -41,6 +64,8 @@ export default function OverviewTab({ data }) {
|
|
|
41
64
|
{ label: t('dashboard.publishedActions'), value: c.actions, color: '#06b6d4' },
|
|
42
65
|
{ label: t('dashboard.activeBoards'), value: c.boards, color: '#22c55e' },
|
|
43
66
|
{ label: t('dashboard.activeChatSessions'), value: c.chat_instances || 0, color: '#06b6d4' },
|
|
67
|
+
{ label: t('dashboard.agentTasksActiveTasks'), value: activeTaskCount != null ? activeTaskCount : '--', color: '#f97316' },
|
|
68
|
+
{ label: t('dashboard.sharingGroupsTotalCount'), value: sharingGroupCount != null ? sharingGroupCount : '--', color: '#8b5cf6' },
|
|
44
69
|
]} />
|
|
45
70
|
|
|
46
71
|
<!-- Economy & Config -->
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file sharing-groups-tab.js
|
|
3
|
+
* @description Admin dashboard tab for browsing all sharing groups across all owners.
|
|
4
|
+
* Shows group name, owner, member count, entry count, and creation date.
|
|
5
|
+
* @version-history
|
|
6
|
+
* v1.0.0 -- 2026-05-21 -- Initial creation for Agent Dashboard Phase 1
|
|
7
|
+
*/
|
|
8
|
+
import { h } from 'preact';
|
|
9
|
+
import { useState, useEffect, useCallback } from 'preact/hooks';
|
|
10
|
+
import htm from 'htm';
|
|
11
|
+
const html = htm.bind(h);
|
|
12
|
+
import { t } from '/js/i18n.js';
|
|
13
|
+
import { escHtml } from '/js/utils.js';
|
|
14
|
+
import { num, dt, Empty } from './shared.js';
|
|
15
|
+
import { apiGet } from '/js/api.js';
|
|
16
|
+
|
|
17
|
+
export default function SharingGroupsTab({ data, reload, session }) {
|
|
18
|
+
const [groups, setGroups] = useState([]);
|
|
19
|
+
const [total, setTotal] = useState(0);
|
|
20
|
+
const [loading, setLoading] = useState(false);
|
|
21
|
+
|
|
22
|
+
const loadGroups = useCallback(async () => {
|
|
23
|
+
setLoading(true);
|
|
24
|
+
try {
|
|
25
|
+
const r = await apiGet('/v1/admin/sharing-groups');
|
|
26
|
+
if (r.data) {
|
|
27
|
+
setGroups(r.data.groups || []);
|
|
28
|
+
setTotal(r.data.total || 0);
|
|
29
|
+
}
|
|
30
|
+
} catch (e) {
|
|
31
|
+
console.warn('Failed to load sharing groups:', e.message);
|
|
32
|
+
}
|
|
33
|
+
setLoading(false);
|
|
34
|
+
}, []);
|
|
35
|
+
|
|
36
|
+
useEffect(() => { loadGroups(); }, [loadGroups]);
|
|
37
|
+
|
|
38
|
+
// Listen for live updates
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
const handler = () => { loadGroups(); };
|
|
41
|
+
window.addEventListener('aimeat-live-update', handler);
|
|
42
|
+
return () => window.removeEventListener('aimeat-live-update', handler);
|
|
43
|
+
}, [loadGroups]);
|
|
44
|
+
|
|
45
|
+
return html`
|
|
46
|
+
<div>
|
|
47
|
+
<!-- Stats summary -->
|
|
48
|
+
<div class="adm-mem-stats">
|
|
49
|
+
<div class="adm-mem-stat">
|
|
50
|
+
<span class="adm-mem-stat-value">${num(total)}</span>
|
|
51
|
+
<span class="adm-mem-stat-label">${t('dashboard.sharingGroupsTotal')}</span>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<!-- Table -->
|
|
56
|
+
${groups.length === 0 && !loading && html`<${Empty} text=${t('dashboard.sharingGroupsEmpty')} />`}
|
|
57
|
+
|
|
58
|
+
${groups.length > 0 && html`
|
|
59
|
+
<div class="adm-card">
|
|
60
|
+
<div class="scrollable">
|
|
61
|
+
<table>
|
|
62
|
+
<thead><tr>
|
|
63
|
+
<th>${t('dashboard.sharingGroupsName')}</th>
|
|
64
|
+
<th>${t('dashboard.sharingGroupsOwner')}</th>
|
|
65
|
+
<th>${t('dashboard.sharingGroupsMembers')}</th>
|
|
66
|
+
<th>${t('dashboard.sharingGroupsEntries')}</th>
|
|
67
|
+
<th>${t('dashboard.sharingGroupsCreated')}</th>
|
|
68
|
+
</tr></thead>
|
|
69
|
+
<tbody>
|
|
70
|
+
${groups.map(g => html`
|
|
71
|
+
<tr>
|
|
72
|
+
<td>${escHtml(g.name)}</td>
|
|
73
|
+
<td class="mono" style="font-size:.8rem">${escHtml(g.owner_gaii)}</td>
|
|
74
|
+
<td>${num(g.member_count)}</td>
|
|
75
|
+
<td>${num(g.entry_count)}</td>
|
|
76
|
+
<td style="color:var(--text-dim)">${dt(g.created_at)}</td>
|
|
77
|
+
</tr>
|
|
78
|
+
`)}
|
|
79
|
+
</tbody>
|
|
80
|
+
</table>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
`}
|
|
84
|
+
</div>
|
|
85
|
+
`;
|
|
86
|
+
}
|