aimeat 2.0.0 → 2.1.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/locales/en.json +35 -1
- package/dist/locales/fi.json +35 -1
- package/dist/public/components/LinkPreview.js +101 -0
- package/dist/public/components/NotificationBell.js +18 -1
- package/dist/public/css/theme.css +57 -7
- package/dist/public/css/views/admin.css +8 -1
- package/dist/public/css/views/app-grant.css +18 -0
- package/dist/public/css/views/inbox.css +46 -0
- package/dist/public/css/views/portfolio.css +46 -0
- package/dist/public/css/views/profile.css +29 -4
- package/dist/public/js/services/apps.js +19 -3
- package/dist/public/js/services/messages-ai-prompts.js +38 -0
- package/dist/public/js/services/messages.js +26 -4
- package/dist/public/js/services/notebook.js +76 -0
- package/dist/public/js/services/unfurl.js +43 -0
- package/dist/public/lib/samples/LICENSE.md +11 -0
- package/dist/public/lib/samples/bass/A1.mp3 +0 -0
- package/dist/public/lib/samples/bass/B2.mp3 +0 -0
- package/dist/public/lib/samples/bass/D2.mp3 +0 -0
- package/dist/public/lib/samples/bass/E1.mp3 +0 -0
- package/dist/public/lib/samples/bass/E3.mp3 +0 -0
- package/dist/public/lib/samples/bass/G2.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C2.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C3.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C4.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C5.mp3 +0 -0
- package/dist/public/lib/samples/epiano/C6.mp3 +0 -0
- package/dist/public/lib/samples/epiano/G2.mp3 +0 -0
- package/dist/public/lib/samples/epiano/G3.mp3 +0 -0
- package/dist/public/lib/samples/epiano/G4.mp3 +0 -0
- package/dist/public/lib/samples/epiano/G5.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/A2.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/A4.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/B3.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/D3.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/E2.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/E4.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/E5.mp3 +0 -0
- package/dist/public/lib/samples/guitar-steel/G3.mp3 +0 -0
- package/dist/public/lib/samples/organ/C2.mp3 +0 -0
- package/dist/public/lib/samples/organ/C3.mp3 +0 -0
- package/dist/public/lib/samples/organ/C4.mp3 +0 -0
- package/dist/public/lib/samples/organ/C5.mp3 +0 -0
- package/dist/public/lib/samples/organ/C6.mp3 +0 -0
- package/dist/public/lib/samples/organ/G2.mp3 +0 -0
- package/dist/public/lib/samples/organ/G3.mp3 +0 -0
- package/dist/public/lib/samples/organ/G4.mp3 +0 -0
- package/dist/public/lib/samples/organ/G5.mp3 +0 -0
- package/dist/public/lib/samples/strings/C2.mp3 +0 -0
- package/dist/public/lib/samples/strings/C3.mp3 +0 -0
- package/dist/public/lib/samples/strings/C4.mp3 +0 -0
- package/dist/public/lib/samples/strings/C5.mp3 +0 -0
- package/dist/public/lib/samples/strings/C6.mp3 +0 -0
- package/dist/public/lib/samples/strings/G2.mp3 +0 -0
- package/dist/public/lib/samples/strings/G3.mp3 +0 -0
- package/dist/public/lib/samples/strings/G4.mp3 +0 -0
- package/dist/public/lib/samples/strings/G5.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/A3.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/A4.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/A5.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/C4.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/C5.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/E3.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/E4.mp3 +0 -0
- package/dist/public/lib/samples/trumpet/E5.mp3 +0 -0
- package/dist/public/spa.html +2 -0
- package/dist/public/views/app-grant.js +24 -4
- package/dist/public/views/portfolio.js +61 -6
- package/dist/public/views/profile/apps-tab.js +18 -1
- package/dist/public/views/profile/inbox-tab/ai-actions.js +86 -0
- package/dist/public/views/profile/inbox-tab/components.js +124 -9
- package/dist/public/views/profile/inbox-tab/helpers.js +26 -0
- package/dist/public/views/profile/inbox-tab/panels.js +18 -3
- package/dist/public/views/profile/inbox-tab/use-thread-ux.js +18 -1
- package/dist/public/views/profile/inbox-tab.js +46 -49
- package/dist/public/views/profile/landing-page.cards.js +7 -0
- package/dist/public/views/profile/landing-page.js +12 -1
- package/dist/public/views/profile/skills-tab.js +1 -1
- package/dist/public/views/public-workspace-viewer.js +1 -1
- package/dist/public/views/start.js +2 -1
- package/dist/scripts/build-sdk-libs.d.ts +16 -0
- package/dist/scripts/build-sdk-libs.d.ts.map +1 -0
- package/dist/scripts/build-sdk-libs.js +112 -0
- package/dist/scripts/build-sdk-libs.js.map +1 -0
- package/dist/src/cli/connect/auth.d.ts +15 -0
- package/dist/src/cli/connect/auth.d.ts.map +1 -1
- package/dist/src/cli/connect/auth.js +25 -6
- package/dist/src/cli/connect/auth.js.map +1 -1
- package/dist/src/cli/connect/keychain.d.ts +9 -0
- package/dist/src/cli/connect/keychain.d.ts.map +1 -1
- package/dist/src/cli/connect/keychain.js +21 -8
- package/dist/src/cli/connect/keychain.js.map +1 -1
- package/dist/src/cli/connect/mcp/tools/exchange.d.ts +18 -0
- package/dist/src/cli/connect/mcp/tools/exchange.d.ts.map +1 -0
- package/dist/src/cli/connect/mcp/tools/exchange.js +170 -0
- package/dist/src/cli/connect/mcp/tools/exchange.js.map +1 -0
- package/dist/src/cli/connect/mcp/tools/index.d.ts.map +1 -1
- package/dist/src/cli/connect/mcp/tools/index.js +2 -0
- package/dist/src/cli/connect/mcp/tools/index.js.map +1 -1
- package/dist/src/cli/connect/tool-call-defs-exchange.d.ts +3 -0
- package/dist/src/cli/connect/tool-call-defs-exchange.d.ts.map +1 -0
- package/dist/src/cli/connect/tool-call-defs-exchange.js +146 -0
- package/dist/src/cli/connect/tool-call-defs-exchange.js.map +1 -0
- package/dist/src/cli/connect/tool-call.d.ts.map +1 -1
- package/dist/src/cli/connect/tool-call.js +2 -0
- package/dist/src/cli/connect/tool-call.js.map +1 -1
- package/dist/src/commerce/session-service.d.ts +14 -0
- package/dist/src/commerce/session-service.d.ts.map +1 -1
- package/dist/src/commerce/session-service.js +1 -1
- package/dist/src/commerce/session-service.js.map +1 -1
- package/dist/src/data/app-templates/shells.d.ts +7 -3
- package/dist/src/data/app-templates/shells.d.ts.map +1 -1
- package/dist/src/data/app-templates/shells.js +10 -6
- package/dist/src/data/app-templates/shells.js.map +1 -1
- package/dist/src/data/appdev-pitfalls.d.ts +2 -0
- package/dist/src/data/appdev-pitfalls.d.ts.map +1 -1
- package/dist/src/data/appdev-pitfalls.js +24 -1
- package/dist/src/data/appdev-pitfalls.js.map +1 -1
- package/dist/src/generated/api-types.d.ts +1565 -9
- package/dist/src/generated/api-types.d.ts.map +1 -1
- package/dist/src/mcp/annotations.d.ts.map +1 -1
- package/dist/src/mcp/annotations.js +20 -0
- package/dist/src/mcp/annotations.js.map +1 -1
- package/dist/src/mcp/apps.d.ts.map +1 -1
- package/dist/src/mcp/apps.js +8 -4
- package/dist/src/mcp/apps.js.map +1 -1
- package/dist/src/mcp/catalog/definitions/exchange.d.ts +18 -0
- package/dist/src/mcp/catalog/definitions/exchange.d.ts.map +1 -0
- package/dist/src/mcp/catalog/definitions/exchange.js +182 -0
- package/dist/src/mcp/catalog/definitions/exchange.js.map +1 -0
- package/dist/src/mcp/catalog/definitions.d.ts.map +1 -1
- package/dist/src/mcp/catalog/definitions.js +2 -0
- package/dist/src/mcp/catalog/definitions.js.map +1 -1
- package/dist/src/mcp/catalog/scopes.d.ts.map +1 -1
- package/dist/src/mcp/catalog/scopes.js +22 -0
- package/dist/src/mcp/catalog/scopes.js.map +1 -1
- package/dist/src/mcp/catalog/surfaces.d.ts.map +1 -1
- package/dist/src/mcp/catalog/surfaces.js +14 -0
- package/dist/src/mcp/catalog/surfaces.js.map +1 -1
- package/dist/src/mcp/exchange-run.d.ts +5 -0
- package/dist/src/mcp/exchange-run.d.ts.map +1 -0
- package/dist/src/mcp/exchange-run.js +226 -0
- package/dist/src/mcp/exchange-run.js.map +1 -0
- package/dist/src/mcp/exchange.d.ts +5 -0
- package/dist/src/mcp/exchange.d.ts.map +1 -0
- package/dist/src/mcp/exchange.js +351 -0
- package/dist/src/mcp/exchange.js.map +1 -0
- package/dist/src/mcp/extensions.d.ts.map +1 -1
- package/dist/src/mcp/extensions.js +11 -0
- 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 +6 -2
- package/dist/src/mcp/index.js.map +1 -1
- package/dist/src/models/app-tool-schemas.d.ts +55 -1
- package/dist/src/models/app-tool-schemas.d.ts.map +1 -1
- package/dist/src/models/app-tool-schemas.js +20 -1
- package/dist/src/models/app-tool-schemas.js.map +1 -1
- package/dist/src/models/offer-schemas.d.ts +2 -2
- package/dist/src/models/schemas.d.ts +1 -0
- package/dist/src/models/schemas.d.ts.map +1 -1
- package/dist/src/models/schemas.js +3 -0
- package/dist/src/models/schemas.js.map +1 -1
- package/dist/src/routes/agents/device-auth.d.ts +4 -0
- package/dist/src/routes/agents/device-auth.d.ts.map +1 -1
- package/dist/src/routes/agents/device-auth.js +19 -4
- package/dist/src/routes/agents/device-auth.js.map +1 -1
- package/dist/src/routes/app-grants.d.ts +6 -0
- package/dist/src/routes/app-grants.d.ts.map +1 -1
- package/dist/src/routes/app-grants.js +35 -2
- package/dist/src/routes/app-grants.js.map +1 -1
- package/dist/src/routes/apps/fork-manage.d.ts.map +1 -1
- package/dist/src/routes/apps/fork-manage.js +24 -1
- package/dist/src/routes/apps/fork-manage.js.map +1 -1
- package/dist/src/routes/apps/publish.d.ts +2 -0
- package/dist/src/routes/apps/publish.d.ts.map +1 -1
- package/dist/src/routes/apps/publish.js +27 -1
- package/dist/src/routes/apps/publish.js.map +1 -1
- package/dist/src/routes/apps-cost.d.ts +25 -0
- package/dist/src/routes/apps-cost.d.ts.map +1 -0
- package/dist/src/routes/apps-cost.js +107 -0
- package/dist/src/routes/apps-cost.js.map +1 -0
- package/dist/src/routes/exchange-market.d.ts +28 -0
- package/dist/src/routes/exchange-market.d.ts.map +1 -0
- package/dist/src/routes/exchange-market.js +454 -0
- package/dist/src/routes/exchange-market.js.map +1 -0
- package/dist/src/routes/exchange.d.ts +33 -0
- package/dist/src/routes/exchange.d.ts.map +1 -0
- package/dist/src/routes/exchange.js +395 -0
- package/dist/src/routes/exchange.js.map +1 -0
- package/dist/src/routes/extensions/entitlement-gate.d.ts +33 -0
- package/dist/src/routes/extensions/entitlement-gate.d.ts.map +1 -0
- package/dist/src/routes/extensions/entitlement-gate.js +143 -0
- package/dist/src/routes/extensions/entitlement-gate.js.map +1 -0
- package/dist/src/routes/extensions/manifest.d.ts +9 -0
- package/dist/src/routes/extensions/manifest.d.ts.map +1 -1
- package/dist/src/routes/extensions/manifest.js +33 -1
- package/dist/src/routes/extensions/manifest.js.map +1 -1
- package/dist/src/routes/extensions/paywall.d.ts.map +1 -1
- package/dist/src/routes/extensions/paywall.js +9 -0
- package/dist/src/routes/extensions/paywall.js.map +1 -1
- package/dist/src/routes/federation-sync/messaging.d.ts.map +1 -1
- package/dist/src/routes/federation-sync/messaging.js +3 -1
- package/dist/src/routes/federation-sync/messaging.js.map +1 -1
- package/dist/src/routes/ghii/recovery.d.ts +2 -0
- package/dist/src/routes/ghii/recovery.d.ts.map +1 -1
- package/dist/src/routes/ghii/recovery.js +7 -0
- package/dist/src/routes/ghii/recovery.js.map +1 -1
- package/dist/src/routes/ghii/register-login.d.ts +4 -0
- package/dist/src/routes/ghii/register-login.d.ts.map +1 -1
- package/dist/src/routes/ghii/register-login.js +45 -22
- package/dist/src/routes/ghii/register-login.js.map +1 -1
- package/dist/src/routes/ghii/web-verify.d.ts +5 -0
- package/dist/src/routes/ghii/web-verify.d.ts.map +1 -1
- package/dist/src/routes/ghii/web-verify.js +24 -3
- package/dist/src/routes/ghii/web-verify.js.map +1 -1
- package/dist/src/routes/libs/sdk-serve.d.ts +11 -0
- package/dist/src/routes/libs/sdk-serve.d.ts.map +1 -0
- package/dist/src/routes/libs/sdk-serve.js +53 -0
- package/dist/src/routes/libs/sdk-serve.js.map +1 -0
- package/dist/src/routes/libs.d.ts +7 -1
- package/dist/src/routes/libs.d.ts.map +1 -1
- package/dist/src/routes/libs.js +65 -146
- package/dist/src/routes/libs.js.map +1 -1
- package/dist/src/routes/messages.d.ts +3 -0
- package/dist/src/routes/messages.d.ts.map +1 -1
- package/dist/src/routes/messages.js +9 -0
- package/dist/src/routes/messages.js.map +1 -1
- package/dist/src/routes/notifications.d.ts +6 -3
- package/dist/src/routes/notifications.d.ts.map +1 -1
- package/dist/src/routes/notifications.js +32 -3
- package/dist/src/routes/notifications.js.map +1 -1
- package/dist/src/routes/organisms/workspace-access.d.ts.map +1 -1
- package/dist/src/routes/organisms/workspace-access.js +38 -20
- package/dist/src/routes/organisms/workspace-access.js.map +1 -1
- package/dist/src/routes/unfurl.d.ts +27 -0
- package/dist/src/routes/unfurl.d.ts.map +1 -0
- package/dist/src/routes/unfurl.js +180 -0
- package/dist/src/routes/unfurl.js.map +1 -0
- package/dist/src/routes/upload.d.ts +2 -0
- package/dist/src/routes/upload.d.ts.map +1 -1
- package/dist/src/routes/upload.js +7 -0
- package/dist/src/routes/upload.js.map +1 -1
- package/dist/src/routes/webmcp.d.ts +3 -0
- package/dist/src/routes/webmcp.d.ts.map +1 -1
- package/dist/src/routes/webmcp.js +55 -0
- package/dist/src/routes/webmcp.js.map +1 -1
- package/dist/src/server-bootstrap/routes-loader.d.ts +1 -0
- package/dist/src/server-bootstrap/routes-loader.d.ts.map +1 -1
- package/dist/src/server-bootstrap/routes-loader.js +8 -0
- package/dist/src/server-bootstrap/routes-loader.js.map +1 -1
- package/dist/src/services/agent-face.d.ts +10 -2
- package/dist/src/services/agent-face.d.ts.map +1 -1
- package/dist/src/services/agent-face.js +10 -4
- package/dist/src/services/agent-face.js.map +1 -1
- package/dist/src/services/app-tool-interfaces.d.ts +37 -0
- package/dist/src/services/app-tool-interfaces.d.ts.map +1 -0
- package/dist/src/services/app-tool-interfaces.js +101 -0
- package/dist/src/services/app-tool-interfaces.js.map +1 -0
- package/dist/src/services/build-app-prompt.d.ts +3 -0
- package/dist/src/services/build-app-prompt.d.ts.map +1 -1
- package/dist/src/services/build-app-prompt.js +12 -1
- package/dist/src/services/build-app-prompt.js.map +1 -1
- package/dist/src/services/contacts.d.ts +25 -1
- package/dist/src/services/contacts.d.ts.map +1 -1
- package/dist/src/services/contacts.js +30 -0
- package/dist/src/services/contacts.js.map +1 -1
- package/dist/src/services/entitlement-money.d.ts +55 -0
- package/dist/src/services/entitlement-money.d.ts.map +1 -0
- package/dist/src/services/entitlement-money.js +68 -0
- package/dist/src/services/entitlement-money.js.map +1 -0
- package/dist/src/services/exchange-market.d.ts +247 -0
- package/dist/src/services/exchange-market.d.ts.map +1 -0
- package/dist/src/services/exchange-market.js +254 -0
- package/dist/src/services/exchange-market.js.map +1 -0
- package/dist/src/services/exchange-proposals.d.ts +47 -0
- package/dist/src/services/exchange-proposals.d.ts.map +1 -0
- package/dist/src/services/exchange-proposals.js +71 -0
- package/dist/src/services/exchange-proposals.js.map +1 -0
- package/dist/src/services/exchange-work.d.ts +30 -0
- package/dist/src/services/exchange-work.d.ts.map +1 -0
- package/dist/src/services/exchange-work.js +43 -0
- package/dist/src/services/exchange-work.js.map +1 -0
- package/dist/src/services/message-send.d.ts.map +1 -1
- package/dist/src/services/message-send.js +4 -1
- package/dist/src/services/message-send.js.map +1 -1
- package/dist/src/services/metered-entitlements.d.ts +203 -0
- package/dist/src/services/metered-entitlements.d.ts.map +1 -0
- package/dist/src/services/metered-entitlements.js +264 -0
- package/dist/src/services/metered-entitlements.js.map +1 -0
- package/dist/src/services/notify.d.ts +7 -0
- package/dist/src/services/notify.d.ts.map +1 -1
- package/dist/src/services/notify.js +35 -0
- package/dist/src/services/notify.js.map +1 -1
- package/dist/src/services/owner-memory.d.ts +16 -0
- package/dist/src/services/owner-memory.d.ts.map +1 -1
- package/dist/src/services/owner-memory.js +23 -0
- package/dist/src/services/owner-memory.js.map +1 -1
- package/dist/src/services/owner-provisioning.d.ts +5 -0
- package/dist/src/services/owner-provisioning.d.ts.map +1 -1
- package/dist/src/services/owner-provisioning.js +20 -2
- package/dist/src/services/owner-provisioning.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/apps.d.ts +1 -0
- package/dist/src/storage/providers/postgres-kysely/methods/apps.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/apps.js +2 -0
- package/dist/src/storage/providers/postgres-kysely/methods/apps.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.d.ts +1 -0
- package/dist/src/storage/providers/postgres-kysely/methods/identity.d.ts.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/methods/identity.js +4 -0
- package/dist/src/storage/providers/postgres-kysely/methods/identity.js.map +1 -1
- package/dist/src/storage/providers/postgres-kysely/migrations/0011_unique_verified_email.sql +25 -0
- package/dist/src/storage/providers/sqlite/methods/apps.d.ts +1 -0
- package/dist/src/storage/providers/sqlite/methods/apps.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/apps.js +2 -0
- package/dist/src/storage/providers/sqlite/methods/apps.js.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.d.ts +1 -0
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.js +4 -0
- package/dist/src/storage/providers/sqlite/methods/identity-nodes.js.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.d.ts.map +1 -1
- package/dist/src/storage/providers/sqlite/schema.js +20 -0
- package/dist/src/storage/providers/sqlite/schema.js.map +1 -1
- package/dist/src/storage/repositories/app.repository.d.ts +0 -0
- package/dist/src/storage/repositories/app.repository.d.ts.map +1 -1
- package/dist/src/storage/repositories/identity.repository.d.ts +6 -0
- package/dist/src/storage/repositories/identity.repository.d.ts.map +1 -1
- package/dist/src/storage/types/apps.d.ts +1 -0
- package/dist/src/storage/types/apps.d.ts.map +1 -1
- package/dist/src/storage/types/organisms-federation.d.ts +21 -0
- package/dist/src/storage/types/organisms-federation.d.ts.map +1 -1
- package/dist/src/utils/app-mobile-lint.d.ts +17 -0
- package/dist/src/utils/app-mobile-lint.d.ts.map +1 -0
- package/dist/src/utils/app-mobile-lint.js +40 -0
- package/dist/src/utils/app-mobile-lint.js.map +1 -0
- package/dist/static/app-catalog/_template.html +12 -77
- package/dist/static/app-catalog/js/apps-io.js +51 -165
- package/dist/static/app-catalog/js/cost.js +100 -0
- package/dist/static/app-catalog/js/db.js +23 -93
- package/dist/static/app-catalog/js/detail.js +158 -24
- package/dist/static/app-catalog/js/favorites.js +71 -0
- package/dist/static/app-catalog/js/i18n-data.js +90 -16
- package/dist/static/app-catalog/js/main.js +23 -103
- package/dist/static/app-catalog/js/migrate.js +88 -0
- package/dist/static/app-catalog/js/monetize.js +1 -1
- package/dist/static/app-catalog/js/promote.js +70 -0
- package/dist/static/app-catalog/js/render.js +26 -139
- package/dist/static/app-catalog/js/server-io.js +126 -223
- package/dist/static/app-catalog/js/settings.js +11 -204
- package/dist/static/app-catalog/styles/app-catalog.css +40 -0
- package/dist/static/app-catalog.html +790 -912
- package/dist/static/sdk-libs/_core/config.js +52 -0
- package/dist/static/sdk-libs/_core/http.js +52 -0
- package/dist/static/sdk-libs/_core/namespace.js +33 -0
- package/dist/static/sdk-libs/_core/sdk-globals.d.ts +50 -0
- package/dist/static/sdk-libs/_core/session.js +66 -0
- package/dist/static/sdk-libs/agentface/index.js +102 -0
- package/dist/static/sdk-libs/agents/index.js +267 -0
- package/dist/static/sdk-libs/ai/index.js +153 -0
- package/dist/static/sdk-libs/audio/core.js +111 -0
- package/dist/static/sdk-libs/audio/index.js +380 -0
- package/dist/static/sdk-libs/audio/instruments.js +369 -0
- package/dist/static/sdk-libs/auth/config.js +46 -0
- package/dist/static/sdk-libs/auth/crypto.js +166 -0
- package/dist/static/sdk-libs/auth/events.js +27 -0
- package/dist/static/sdk-libs/auth/i18n.js +64 -0
- package/dist/static/sdk-libs/auth/index.js +37 -0
- package/dist/static/sdk-libs/auth/modal.js +545 -0
- package/dist/static/sdk-libs/auth/pill.js +167 -0
- package/dist/static/sdk-libs/auth/session.js +792 -0
- package/dist/static/sdk-libs/auth/signup.js +232 -0
- package/dist/static/sdk-libs/auth/theme.js +96 -0
- package/dist/static/sdk-libs/capabilities/index.js +179 -0
- package/dist/static/sdk-libs/commerce/index.js +243 -0
- package/dist/static/sdk-libs/data/index.js +188 -0
- package/dist/static/sdk-libs/dist/aimeat-agentface.js +91 -0
- package/dist/static/sdk-libs/dist/aimeat-agents.js +315 -0
- package/dist/static/sdk-libs/dist/aimeat-ai.js +168 -0
- package/dist/static/sdk-libs/dist/aimeat-audio.js +979 -0
- package/dist/static/sdk-libs/dist/aimeat-auth.js +1831 -0
- package/dist/static/sdk-libs/dist/aimeat-capabilities.js +177 -0
- package/dist/static/sdk-libs/dist/aimeat-commerce.js +265 -0
- package/dist/static/sdk-libs/dist/aimeat-data.js +205 -0
- package/dist/static/sdk-libs/dist/aimeat-editor.js +299 -0
- package/dist/static/sdk-libs/dist/aimeat-header.js +270 -0
- package/dist/static/sdk-libs/dist/aimeat-intake.js +94 -0
- package/dist/static/sdk-libs/dist/aimeat-live.js +265 -0
- package/dist/static/sdk-libs/dist/aimeat-markdown.js +602 -0
- package/dist/static/sdk-libs/dist/aimeat-organism.js +394 -0
- package/dist/static/sdk-libs/dist/aimeat-portfolio-standalone.js +90 -0
- package/dist/static/sdk-libs/dist/aimeat-social.js +157 -0
- package/dist/static/sdk-libs/dist/aimeat-speech.js +300 -0
- package/dist/static/sdk-libs/dist/aimeat-storage.js +210 -0
- package/dist/static/sdk-libs/dist/aimeat-tunnel.js +383 -0
- package/dist/static/sdk-libs/dist/aimeat-wallet.js +118 -0
- package/dist/static/sdk-libs/dist/aimeat-webmcp.js +187 -0
- package/dist/static/sdk-libs/dist/aimeat-work.js +213 -0
- package/dist/static/sdk-libs/dist/aimeat-workflows.js +147 -0
- package/dist/static/sdk-libs/editor/index.js +229 -0
- package/dist/static/sdk-libs/header/index.js +249 -0
- package/dist/static/sdk-libs/intake/index.js +75 -0
- package/dist/static/sdk-libs/live/index.js +156 -0
- package/dist/static/sdk-libs/markdown/index.js +522 -0
- package/dist/static/sdk-libs/organism/index.js +381 -0
- package/dist/static/sdk-libs/portfolio-standalone/index.js +78 -0
- package/dist/static/sdk-libs/social/index.js +140 -0
- package/dist/static/sdk-libs/speech/index.js +321 -0
- package/dist/static/sdk-libs/storage/index.js +189 -0
- package/dist/static/sdk-libs/tunnel/index.js +428 -0
- package/dist/static/sdk-libs/wallet/index.js +115 -0
- package/dist/static/sdk-libs/webmcp/index.js +185 -0
- package/dist/static/sdk-libs/work/index.js +191 -0
- package/dist/static/sdk-libs/workflows/index.js +113 -0
- package/package.json +5 -2
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file server-io.js
|
|
3
|
-
* @description Everything that talks to the NODE about apps:
|
|
4
|
-
* two-view (Library/Community) + operator subdomain mappings, H-2
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* main-local fns (+ closeModal
|
|
8
|
-
*
|
|
9
|
-
* @usage import { initServerIo, loadPublishedApps, importFromAimeat } from './server-io.js'; initServerIo({...})
|
|
3
|
+
* @description Everything that talks to the NODE about apps: publish (incl. the create-flow
|
|
4
|
+
* publish-then-unlist), the two-view (Library/Community) + operator subdomain mappings, H-2
|
|
5
|
+
* app-grant consents, and the .zip backup export/restore. Owns no state itself — the shared
|
|
6
|
+
* app-state lives in main and is read via injected getters / written via injected setters;
|
|
7
|
+
* main-local fns (+ closeModal from apps-io) injected via initServerIo(deps). Carved from main.js.
|
|
8
|
+
* @usage import { initServerIo, loadPublishedApps, showPublishModal } from './server-io.js'; initServerIo({...})
|
|
10
9
|
* @version-history
|
|
11
10
|
* v1.0.0 — 2026-07-10 — Initial extraction (TARGET-021 Aalto 3 modularization, phase 11).
|
|
11
|
+
* v2.0.0 — 2026-07-20 — Server-only cutover: drop "Import from AIMEAT" (offline server→local import);
|
|
12
|
+
* the create flow publishes then parks so a new app lands unlisted.
|
|
12
13
|
*/
|
|
13
14
|
import { escapeHtml, jsArg, bareOwnerName, sameOwner, filterAttr } from './util.js';
|
|
14
|
-
import { getAllApps, saveApp
|
|
15
|
+
import { getAllApps, saveApp } from './db.js';
|
|
15
16
|
import { showConfirm, showNotice } from './ui.js';
|
|
16
17
|
import { loadConfig } from './config.js';
|
|
17
|
-
import { t } from './i18n.js';
|
|
18
|
-
import { closeModal
|
|
18
|
+
import { t, getLang } from './i18n.js';
|
|
19
|
+
import { closeModal } from './apps-io.js';
|
|
19
20
|
import { getCortexOwnerToken } from './cortex.js';
|
|
20
21
|
import { fetchAppContentBase64, refreshServerMgmt } from './detail.js';
|
|
22
|
+
import { favStarHtml, isFavorite, loadFavorites } from './favorites.js';
|
|
23
|
+
import { loadPromoted } from './promote.js';
|
|
21
24
|
|
|
22
25
|
// Injected once at bootstrap by main.js: read getters + write setters for the shared app-state
|
|
23
26
|
// (which stays main-owned), plus a few main-local fns.
|
|
@@ -26,170 +29,20 @@ export function initServerIo(deps) {
|
|
|
26
29
|
({ getMainApps, getServerState, getServerManifests, setServerManifests, getOwnServerApps, setOwnServerApps, getActiveTag, getSearchQuery, generateId, renderApps, refreshAll } = deps);
|
|
27
30
|
}
|
|
28
31
|
|
|
29
|
-
//
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
function formatFileSize(bytes) {
|
|
34
|
-
if (bytes < 1024) return bytes + ' B';
|
|
35
|
-
if (bytes < 1048576) return (bytes / 1024).toFixed(1) + ' KB';
|
|
36
|
-
return (bytes / 1048576).toFixed(1) + ' MB';
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function importFromAimeat() {
|
|
40
|
-
var config = loadConfig();
|
|
41
|
-
if (!config.aimeatUrl) {
|
|
42
|
-
showNotice('Set AIMEAT server URL in Settings first');
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var aimeatUrl = config.aimeatUrl.replace(/\/+$/, ''); // strip trailing slash
|
|
47
|
-
closeModal();
|
|
48
|
-
|
|
49
|
-
fetch(aimeatUrl + '/v1/apps?include_peers=true')
|
|
50
|
-
.then(function (resp) {
|
|
51
|
-
if (!resp.ok) throw new Error('Server returned ' + resp.status);
|
|
52
|
-
return resp.json();
|
|
53
|
-
})
|
|
54
|
-
.then(function (json) {
|
|
55
|
-
var apps = json.data && json.data.apps ? json.data.apps : [];
|
|
56
|
-
var peerApps = json.data && json.data.peer_apps ? json.data.peer_apps : [];
|
|
57
|
-
// Merge local and peer apps; tag peer apps with source info
|
|
58
|
-
for (var p = 0; p < peerApps.length; p++) {
|
|
59
|
-
peerApps[p]._from_peer = true;
|
|
60
|
-
}
|
|
61
|
-
var allFetched = apps.concat(peerApps);
|
|
62
|
-
if (allFetched.length === 0) {
|
|
63
|
-
showNotice('No apps found on the AIMEAT server');
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
aimeatAppsCache = allFetched;
|
|
67
|
-
showAimeatImportDialog(allFetched, aimeatUrl);
|
|
68
|
-
})
|
|
69
|
-
.catch(function (err) {
|
|
70
|
-
var msg = 'Failed to fetch apps from AIMEAT server.\n\n' + (err.message || err);
|
|
71
|
-
if (err.message && err.message.indexOf('Failed to fetch') !== -1) {
|
|
72
|
-
msg += '\n\nIf the launcher is opened via file://, CORS will block the request. Open it from the AIMEAT server instead.';
|
|
73
|
-
}
|
|
74
|
-
showNotice(msg);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function showAimeatImportDialog(apps, aimeatUrl) {
|
|
79
|
-
var listEl = document.getElementById('aimeat-app-list');
|
|
80
|
-
var html = '';
|
|
81
|
-
for (var i = 0; i < apps.length; i++) {
|
|
82
|
-
var app = apps[i];
|
|
83
|
-
var displayName = (app.manifest && app.manifest.name) ? app.manifest.name : app.filename;
|
|
84
|
-
var displayAuthor = (app.manifest && app.manifest.authorDisplay) ? app.manifest.authorDisplay : (app.owner || '');
|
|
85
|
-
var displayDesc = (app.manifest && app.manifest.description) ? app.manifest.description : '';
|
|
86
|
-
var displayVer = app.version_number ? 'v' + app.version_number : '';
|
|
87
|
-
var displayCat = (app.manifest && app.manifest.category) ? app.manifest.category : '';
|
|
88
|
-
var peerLabel = app._from_peer && app._peer_node ? ' \u00B7 \uD83C\uDF10 ' + escapeHtml(app._peer_node) : '';
|
|
89
|
-
html +=
|
|
90
|
-
'<div class="aimeat-app-item">' +
|
|
91
|
-
'<input type="checkbox" data-index="' + i + '" checked/>' +
|
|
92
|
-
'<div class="aimeat-app-info">' +
|
|
93
|
-
'<div class="aimeat-app-name">' + escapeHtml(displayName) + (displayVer ? ' <span style="opacity:.5;font-size:.85em">' + escapeHtml(displayVer) + '</span>' : '') + '</div>' +
|
|
94
|
-
'<div class="aimeat-app-size">' + formatFileSize(app.size) + (displayAuthor ? ' \u00B7 ' + escapeHtml(displayAuthor) : '') + (displayCat ? ' \u00B7 ' + escapeHtml(displayCat) : '') + peerLabel + '</div>' +
|
|
95
|
-
(displayDesc ? '<div class="aimeat-app-size" style="opacity:.6">' + escapeHtml(displayDesc.substring(0, 100)) + '</div>' : '') +
|
|
96
|
-
'</div>' +
|
|
97
|
-
'<select data-index="' + i + '">' +
|
|
98
|
-
'<option value="link">Link (online only)</option>' +
|
|
99
|
-
'<option value="download">Download (offline)</option>' +
|
|
100
|
-
'</select>' +
|
|
101
|
-
'</div>';
|
|
102
|
-
}
|
|
103
|
-
listEl.innerHTML = html;
|
|
104
|
-
// Store the aimeatUrl for processing
|
|
105
|
-
listEl.dataset.aimeatUrl = aimeatUrl;
|
|
106
|
-
document.getElementById('aimeat-import-overlay').hidden = false;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function processAimeatImport() {
|
|
110
|
-
var listEl = document.getElementById('aimeat-app-list');
|
|
111
|
-
var aimeatUrl = listEl.dataset.aimeatUrl;
|
|
112
|
-
var checkboxes = listEl.querySelectorAll('input[type="checkbox"]');
|
|
113
|
-
var selects = listEl.querySelectorAll('select');
|
|
114
|
-
var config = loadConfig();
|
|
115
|
-
var defaultOpenMode = config.defaultOpenMode || 'tab';
|
|
116
|
-
|
|
117
|
-
var toImport = [];
|
|
118
|
-
for (var i = 0; i < checkboxes.length; i++) {
|
|
119
|
-
if (checkboxes[i].checked) {
|
|
120
|
-
var idx = parseInt(checkboxes[i].getAttribute('data-index'), 10);
|
|
121
|
-
var mode = selects[i].value;
|
|
122
|
-
toImport.push({ app: aimeatAppsCache[idx], mode: mode });
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (toImport.length === 0) {
|
|
127
|
-
showNotice('No apps selected');
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
var promises = [];
|
|
132
|
-
for (var j = 0; j < toImport.length; j++) {
|
|
133
|
-
(function (item) {
|
|
134
|
-
var app = item.app;
|
|
135
|
-
var name = (app.manifest && app.manifest.name) ? app.manifest.name : app.filename.replace(/\.html?$/i, '');
|
|
136
|
-
var importedVersion = app.version_number || 1;
|
|
137
|
-
// For peer apps, use the peer's URL as the base
|
|
138
|
-
var baseUrl = (app._from_peer && app._peer_url) ? app._peer_url.replace(/\/+$/, '') : aimeatUrl;
|
|
139
|
-
|
|
140
|
-
if (item.mode === 'link') {
|
|
141
|
-
// Link mode: store URL with ?mode=inline, pinned to latest
|
|
142
|
-
var inlineUrl = baseUrl + app.download_url + '?mode=inline';
|
|
143
|
-
promises.push(addAppFromUrl(name, inlineUrl, '\u{1F4E6}', ['aimeat'], defaultOpenMode));
|
|
144
|
-
} else {
|
|
145
|
-
// Download mode: fetch content and store blob (pinned to current version)
|
|
146
|
-
var downloadUrl = baseUrl + app.download_url;
|
|
147
|
-
promises.push(
|
|
148
|
-
fetch(downloadUrl)
|
|
149
|
-
.then(function (resp) {
|
|
150
|
-
if (!resp.ok) throw new Error('Download failed: ' + resp.status);
|
|
151
|
-
return resp.text();
|
|
152
|
-
})
|
|
153
|
-
.then(function (content) {
|
|
154
|
-
var encoded = btoa(unescape(encodeURIComponent(content)));
|
|
155
|
-
var record = {
|
|
156
|
-
id: generateId(),
|
|
157
|
-
name: name,
|
|
158
|
-
description: (app.manifest && app.manifest.description) ? app.manifest.description : '',
|
|
159
|
-
source: 'aimeat',
|
|
160
|
-
aimeatOwner: app.owner || null,
|
|
161
|
-
aimeatFilename: app.filename || null,
|
|
162
|
-
aimeatVersion: importedVersion,
|
|
163
|
-
url: null,
|
|
164
|
-
blob: encoded,
|
|
165
|
-
tags: ['aimeat'],
|
|
166
|
-
openMode: defaultOpenMode,
|
|
167
|
-
icon: '\u{1F4E6}',
|
|
168
|
-
screenshot: null,
|
|
169
|
-
favorite: false,
|
|
170
|
-
addedAt: new Date().toISOString(),
|
|
171
|
-
lastOpenedAt: null
|
|
172
|
-
};
|
|
173
|
-
return saveApp(record);
|
|
174
|
-
})
|
|
175
|
-
);
|
|
176
|
-
}
|
|
177
|
-
})(toImport[j]);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
Promise.all(promises).then(function () {
|
|
181
|
-
document.getElementById('aimeat-import-overlay').hidden = true;
|
|
182
|
-
renderApps();
|
|
183
|
-
}).catch(function (err) {
|
|
184
|
-
showNotice('Import error: ' + (err.message || err));
|
|
185
|
-
});
|
|
186
|
-
}
|
|
32
|
+
// Cache of the last full server-app list (own + community) + base URL, so a favourite toggle can
|
|
33
|
+
// re-render the ⭐ group + all star states without a network round-trip.
|
|
34
|
+
let lastAllServerApps = [];
|
|
35
|
+
let lastAimeatUrl = '';
|
|
187
36
|
|
|
188
37
|
// ── Publish to AIMEAT ───────────────────────────
|
|
189
38
|
|
|
190
39
|
var publishAppId = null;
|
|
40
|
+
// When the publish is driven by the "Add app" create flow we park the app straight after publishing
|
|
41
|
+
// so a freshly-created app lands UNLISTED (on the server, not yet public) rather than instantly live.
|
|
42
|
+
var publishUnlisted = false;
|
|
191
43
|
|
|
192
|
-
function showPublishModal(appId) {
|
|
44
|
+
function showPublishModal(appId, opts) {
|
|
45
|
+
publishUnlisted = !!(opts && opts.unlisted);
|
|
193
46
|
var app = null;
|
|
194
47
|
for (var i = 0; i < getMainApps().length; i++) {
|
|
195
48
|
if (getMainApps()[i].id === appId) { app = getMainApps()[i]; break; }
|
|
@@ -330,6 +183,13 @@ function submitPublish() {
|
|
|
330
183
|
app.publishedVersionNumber = json.data.version_number || 1;
|
|
331
184
|
app.publishedVersionsUrl = json.data.versions_url || null;
|
|
332
185
|
saveApp(app).then(function() {
|
|
186
|
+
// Create flow: park it immediately so the new app is UNLISTED (server-only, not public).
|
|
187
|
+
if (publishUnlisted) {
|
|
188
|
+
app.parked = true;
|
|
189
|
+
statusEl.textContent = '\u2714 ' + (t('publish.savedUnlisted') || 'Saved (unlisted)');
|
|
190
|
+
try { toggleParkApp(filename, true); } catch (e) { /* park is best-effort */ }
|
|
191
|
+
}
|
|
192
|
+
publishUnlisted = false;
|
|
333
193
|
loadPublishedApps();
|
|
334
194
|
// Close the modal shortly after showing success \u2014 otherwise it dead-ends with a
|
|
335
195
|
// disabled button and the user isn't sure the publish took.
|
|
@@ -942,7 +802,9 @@ function loadPublishedApps() {
|
|
|
942
802
|
}
|
|
943
803
|
} catch(e) {}
|
|
944
804
|
|
|
945
|
-
|
|
805
|
+
// Load the owner's favourites alongside the app list so the ⭐ group + stars match the current
|
|
806
|
+
// session (also refreshes them on an auth change, which routes through here via refreshAll).
|
|
807
|
+
Promise.all([getAllApps(), loadFavorites(), loadPromoted()]).then(function() {
|
|
946
808
|
if (!aimeatUrl) {
|
|
947
809
|
setOwnServerApps([]);
|
|
948
810
|
renderApps();
|
|
@@ -974,14 +836,18 @@ function loadPublishedApps() {
|
|
|
974
836
|
? serverApps.filter(function(a) { return !sameOwner(a.owner, currentOwner); })
|
|
975
837
|
: serverApps;
|
|
976
838
|
|
|
839
|
+
// Cache the FULL list (own + community) so a favourite toggle can re-render the ⭐ group
|
|
840
|
+
// and the star state in place, without another round-trip.
|
|
841
|
+
lastAllServerApps = serverApps;
|
|
842
|
+
lastAimeatUrl = aimeatUrl;
|
|
843
|
+
|
|
977
844
|
return loadSubdomainSites().then(function () {
|
|
978
|
-
//
|
|
979
|
-
//
|
|
980
|
-
// filename; buildLibraryEntries handles the parked/published state). Logged out →
|
|
981
|
-
// no owner server apps (a visitor browses everything under Community).
|
|
845
|
+
// Kirjasto grid: the owner's server apps (published + parked). Logged out → none
|
|
846
|
+
// (a visitor browses everything under Community).
|
|
982
847
|
setOwnServerApps(currentOwner ? ownApps : []);
|
|
983
848
|
renderApps();
|
|
984
849
|
renderCommunityApps(communityApps, aimeatUrl, communitySection, communityGrid, communityCountEl, currentOwner);
|
|
850
|
+
renderFavorites(serverApps, aimeatUrl); // ⭐ group pinned atop the Library
|
|
985
851
|
applyServerFilter(); // re-apply any active search/tag to the community cards
|
|
986
852
|
});
|
|
987
853
|
})
|
|
@@ -1024,6 +890,55 @@ function applyServerFilter() {
|
|
|
1024
890
|
if (sectionEl) sectionEl.style.display = (filtering && shown === 0) ? 'none' : '';
|
|
1025
891
|
}
|
|
1026
892
|
|
|
893
|
+
// One published-app card (used by BOTH the Community grid and the ⭐ Favourites group). Carries a
|
|
894
|
+
// favourite toggle + a description localized to the current UI language.
|
|
895
|
+
function publishedCardHtml(sa, aimeatUrl) {
|
|
896
|
+
var owner = sa.owner || '';
|
|
897
|
+
var fn = sa.filename || '';
|
|
898
|
+
var ref = owner + '/' + fn;
|
|
899
|
+
var m = sa.manifest || {};
|
|
900
|
+
var name = m.name || fn;
|
|
901
|
+
var version = sa.version_number ? 'v' + sa.version_number : '';
|
|
902
|
+
var description = (m.descriptions && m.descriptions[getLang()]) || m.description || '';
|
|
903
|
+
var date = sa.created_at ? new Date(sa.created_at).toLocaleDateString() : '';
|
|
904
|
+
var author = m.authorDisplay || owner;
|
|
905
|
+
var viewUrl = aimeatUrl + '/v1/apps/' + encodeURIComponent(owner) + '/' + encodeURIComponent(fn);
|
|
906
|
+
// Agent-Bundled Apps: this app ships its own agent(s) — badge it and offer the Bundled-agents modal.
|
|
907
|
+
var shipsAgent = !!(m.cortex && m.cortex.agents && m.cortex.agents.length);
|
|
908
|
+
return '<div class="published-card"' + filterAttr(name, m.tags || []) + '>' +
|
|
909
|
+
favStarHtml(ref) +
|
|
910
|
+
'<div class="published-card-name">' + escapeHtml(name) + '</div>' +
|
|
911
|
+
(description ? '<div class="published-card-desc">' + escapeHtml(description) + '</div>' : '') +
|
|
912
|
+
'<div class="published-card-footer">' +
|
|
913
|
+
'<div class="published-card-metaline">' +
|
|
914
|
+
'<span class="pcm-main" style="color:var(--accent)">👤 ' + escapeHtml(author) + '</span>' +
|
|
915
|
+
(date ? '<span class="pcm-date">' + date + '</span>' : '') +
|
|
916
|
+
'</div>' +
|
|
917
|
+
'<div class="published-card-actions">' +
|
|
918
|
+
'<button onclick="window._launcher.viewPublished(\'' + escapeHtml(viewUrl) + '?mode=inline\', \'' + jsArg(name) + '\')">' + t('card.view') + '</button>' +
|
|
919
|
+
// Fork is offered on a community app only when its owner marked it forkable.
|
|
920
|
+
(sa.forkable
|
|
921
|
+
? '<button onclick="window._launcher.forkVersion(\'' + escapeHtml(owner) + '\', \'' + escapeHtml(fn) + '\', ' + (sa.version_number || 0) + ')" title="' + escapeHtml(t('card.forkHint')) + '">' + t('card.fork') + '</button>'
|
|
922
|
+
: '') +
|
|
923
|
+
(shipsAgent
|
|
924
|
+
? '<button onclick="window._launcher.showAppAgentsModal(\'' + jsArg(owner) + '\', \'' + jsArg(fn) + '\')" title="' + escapeHtml(t('card.agentHint')) + '">' + t('card.agent') + '</button>'
|
|
925
|
+
: '') +
|
|
926
|
+
'</div>' +
|
|
927
|
+
((version || (sa.forks && sa.forks > 0) || shipsAgent)
|
|
928
|
+
? '<div class="published-card-badgerow">'
|
|
929
|
+
+ (shipsAgent
|
|
930
|
+
? '<span class="pcb-agent" title="' + escapeHtml(t('card.agentHint')) + '">🤖</span>'
|
|
931
|
+
: '')
|
|
932
|
+
+ ((sa.forks && sa.forks > 0)
|
|
933
|
+
? '<span class="pcb-forks" title="' + escapeHtml(t('card.forksHint')) + '" onclick="window._launcher.showLineageModal(\'' + escapeHtml(owner) + '\', \'' + escapeHtml(fn) + '\')">⑂ ' + sa.forks + '</span>'
|
|
934
|
+
: '')
|
|
935
|
+
+ (version ? '<span class="pcb-version">' + escapeHtml(version) + '</span>' : '')
|
|
936
|
+
+ '</div>'
|
|
937
|
+
: '') +
|
|
938
|
+
'</div>' +
|
|
939
|
+
'</div>';
|
|
940
|
+
}
|
|
941
|
+
|
|
1027
942
|
function renderCommunityApps(serverApps, aimeatUrl, section, grid, countEl, currentOwner) {
|
|
1028
943
|
if (!section || !grid || !countEl) return;
|
|
1029
944
|
if (serverApps.length === 0) {
|
|
@@ -1032,60 +947,49 @@ function renderCommunityApps(serverApps, aimeatUrl, section, grid, countEl, curr
|
|
|
1032
947
|
updateCommunityEmpty();
|
|
1033
948
|
return;
|
|
1034
949
|
}
|
|
1035
|
-
|
|
1036
950
|
section.style.display = '';
|
|
1037
951
|
countEl.textContent = '(' + serverApps.length + ')';
|
|
1038
|
-
|
|
1039
952
|
var html = '';
|
|
1040
|
-
for (var i = 0; i < serverApps.length; i++)
|
|
1041
|
-
var sa = serverApps[i];
|
|
1042
|
-
var name = (sa.manifest && sa.manifest.name) ? sa.manifest.name : (sa.filename || '');
|
|
1043
|
-
var version = sa.version_number ? 'v' + sa.version_number : '';
|
|
1044
|
-
var description = (sa.manifest && sa.manifest.description) ? sa.manifest.description : '';
|
|
1045
|
-
var date = sa.created_at ? new Date(sa.created_at).toLocaleDateString() : '';
|
|
1046
|
-
var author = (sa.manifest && sa.manifest.authorDisplay) ? sa.manifest.authorDisplay : (sa.owner || '');
|
|
1047
|
-
var viewUrl = aimeatUrl + '/v1/apps/' + encodeURIComponent(sa.owner || '') + '/' + encodeURIComponent(sa.filename || '');
|
|
1048
|
-
// Agent-Bundled Apps: this app ships its own agent(s) — badge it and offer the
|
|
1049
|
-
// Bundled-agents modal (inspect the crew-def, use a hosted instance, or deploy your own).
|
|
1050
|
-
var shipsAgent = !!(sa.manifest && sa.manifest.cortex && sa.manifest.cortex.agents && sa.manifest.cortex.agents.length);
|
|
1051
|
-
html +=
|
|
1052
|
-
'<div class="published-card"' + filterAttr(name, (sa.manifest && sa.manifest.tags) || []) + '>' +
|
|
1053
|
-
'<div class="published-card-name">' + escapeHtml(name) + '</div>' +
|
|
1054
|
-
(description ? '<div class="published-card-desc">' + escapeHtml(description) + '</div>' : '') +
|
|
1055
|
-
'<div class="published-card-footer">' +
|
|
1056
|
-
'<div class="published-card-metaline">' +
|
|
1057
|
-
'<span class="pcm-main" style="color:var(--accent)">👤 ' + escapeHtml(author) + '</span>' +
|
|
1058
|
-
(date ? '<span class="pcm-date">' + date + '</span>' : '') +
|
|
1059
|
-
'</div>' +
|
|
1060
|
-
'<div class="published-card-actions">' +
|
|
1061
|
-
'<button onclick="window._launcher.viewPublished(\'' + escapeHtml(viewUrl) + '?mode=inline\', \'' + jsArg(name) + '\')">' + t('card.view') + '</button>' +
|
|
1062
|
-
// Fork is offered on a community (someone else's) app only when its owner
|
|
1063
|
-
// marked it forkable; otherwise the server would reject the fork (403).
|
|
1064
|
-
(sa.forkable
|
|
1065
|
-
? '<button onclick="window._launcher.forkVersion(\'' + escapeHtml(sa.owner || '') + '\', \'' + escapeHtml(sa.filename || '') + '\', ' + (sa.version_number || 0) + ')" title="' + escapeHtml(t('card.forkHint')) + '">' + t('card.fork') + '</button>'
|
|
1066
|
-
: '') +
|
|
1067
|
-
(shipsAgent
|
|
1068
|
-
? '<button onclick="window._launcher.showAppAgentsModal(\'' + jsArg(sa.owner || '') + '\', \'' + jsArg(sa.filename || '') + '\')" title="' + escapeHtml(t('card.agentHint')) + '">' + t('card.agent') + '</button>'
|
|
1069
|
-
: '') +
|
|
1070
|
-
'</div>' +
|
|
1071
|
-
((version || (sa.forks && sa.forks > 0) || shipsAgent)
|
|
1072
|
-
? '<div class="published-card-badgerow">'
|
|
1073
|
-
+ (shipsAgent
|
|
1074
|
-
? '<span class="pcb-agent" title="' + escapeHtml(t('card.agentHint')) + '">🤖</span>'
|
|
1075
|
-
: '')
|
|
1076
|
-
+ ((sa.forks && sa.forks > 0)
|
|
1077
|
-
? '<span class="pcb-forks" title="' + escapeHtml(t('card.forksHint')) + '" onclick="window._launcher.showLineageModal(\'' + escapeHtml(sa.owner || '') + '\', \'' + escapeHtml(sa.filename || '') + '\')">⑂ ' + sa.forks + '</span>'
|
|
1078
|
-
: '')
|
|
1079
|
-
+ (version ? '<span class="pcb-version">' + escapeHtml(version) + '</span>' : '')
|
|
1080
|
-
+ '</div>'
|
|
1081
|
-
: '') +
|
|
1082
|
-
'</div>' +
|
|
1083
|
-
'</div>';
|
|
1084
|
-
}
|
|
953
|
+
for (var i = 0; i < serverApps.length; i++) html += publishedCardHtml(serverApps[i], aimeatUrl);
|
|
1085
954
|
grid.innerHTML = html;
|
|
1086
955
|
updateCommunityEmpty();
|
|
1087
956
|
}
|
|
1088
957
|
|
|
958
|
+
// The ⭐ Favourites group (Library view): apps the owner favourited, drawn from the FULL server-app
|
|
959
|
+
// list (own + community). Pinned above "Your apps"; hidden when there are none.
|
|
960
|
+
function renderFavorites(allServerApps, aimeatUrl) {
|
|
961
|
+
var section = document.getElementById('favorites-section');
|
|
962
|
+
var grid = document.getElementById('favorites-grid');
|
|
963
|
+
var countEl = document.getElementById('favorites-count');
|
|
964
|
+
if (!section || !grid) return;
|
|
965
|
+
var favs = (allServerApps || []).filter(function (sa) { return isFavorite((sa.owner || '') + '/' + (sa.filename || '')); });
|
|
966
|
+
if (favs.length === 0) { section.style.display = 'none'; grid.innerHTML = ''; return; }
|
|
967
|
+
section.style.display = '';
|
|
968
|
+
if (countEl) countEl.textContent = '(' + favs.length + ')';
|
|
969
|
+
var html = '';
|
|
970
|
+
for (var i = 0; i < favs.length; i++) html += publishedCardHtml(favs[i], aimeatUrl);
|
|
971
|
+
grid.innerHTML = html;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
// Re-render everything that shows a star (own grid, community grid, ⭐ group) from the cached list
|
|
975
|
+
// after a favourite toggle — no re-fetch. Called by the _launcher.toggleFavorite handler.
|
|
976
|
+
function refreshFavoritesUI() {
|
|
977
|
+
renderFavorites(lastAllServerApps, lastAimeatUrl);
|
|
978
|
+
var currentOwner = null;
|
|
979
|
+
try {
|
|
980
|
+
var s = (window.AIMEAT && window.AIMEAT.auth && window.AIMEAT.auth.getSession());
|
|
981
|
+
currentOwner = (s && s.owner) || (JSON.parse(localStorage.getItem('aimeat_session') || '{}').owner) || null;
|
|
982
|
+
} catch (e) { /* anonymous */ }
|
|
983
|
+
var communityApps = currentOwner
|
|
984
|
+
? lastAllServerApps.filter(function (a) { return !sameOwner(a.owner, currentOwner); })
|
|
985
|
+
: lastAllServerApps;
|
|
986
|
+
renderCommunityApps(communityApps, lastAimeatUrl,
|
|
987
|
+
document.getElementById('community-section'), document.getElementById('community-grid'),
|
|
988
|
+
document.getElementById('community-count'), currentOwner);
|
|
989
|
+
applyServerFilter();
|
|
990
|
+
renderApps(); // own-grid stars
|
|
991
|
+
}
|
|
992
|
+
|
|
1089
993
|
// Render the owner's PARKED apps in their own section. A parked app is hidden from
|
|
1090
994
|
// the public catalogue but stays fully usable by the owner; the primary action here
|
|
1091
995
|
// is Publish (unpark), which moves it back into Published Apps.
|
|
@@ -1204,8 +1108,6 @@ async function deleteServerApp(filename) {
|
|
|
1204
1108
|
|
|
1205
1109
|
export {
|
|
1206
1110
|
isOperatorSession,
|
|
1207
|
-
importFromAimeat,
|
|
1208
|
-
processAimeatImport,
|
|
1209
1111
|
showPublishModal,
|
|
1210
1112
|
submitPublish,
|
|
1211
1113
|
toggleCommunity,
|
|
@@ -1227,6 +1129,7 @@ export {
|
|
|
1227
1129
|
backupSelectAll,
|
|
1228
1130
|
submitBackupRestore,
|
|
1229
1131
|
loadPublishedApps,
|
|
1132
|
+
refreshFavoritesUI,
|
|
1230
1133
|
applyServerFilter,
|
|
1231
1134
|
unpublishApp,
|
|
1232
1135
|
toggleParkApp,
|