@xopcai/xopc 0.0.364 → 0.0.367
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/browser-ext/dist/sidepanel.js +16 -4
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-GvR2gZ0T.js → activity-store-Cuf3JFFJ.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-7Ct-ZlfL.js → agent-avatar-dicebear-DyATPNTe.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-gT9_j4tr.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CLXCJ6JN.js +1 -0
- package/dist/gateway/static/root/assets/agents-BAUfOMsq.js +66 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-BkXb7VEZ.js → agents-admin-api-D842OcNo.js} +1 -1
- package/dist/gateway/static/root/assets/app-link-4gpFbdsr.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CjfsIn9A.js → app-management-settings-panel-CoIFxQKH.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-qqHZ15GU.js → appearance-settings-DQr0o6Lm.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Ba2VkQk6.js → apps-page-CltMV4Xp.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CKe3qAaL.js → archive-plugin-DT8Nio-r.js} +1 -1
- package/dist/gateway/static/root/assets/automation-display-DCkjVzA0.js +2 -0
- package/dist/gateway/static/root/assets/{automations-page-Bt8Q58ut.js → automations-page-BIfWS_3Y.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BCGPjsdU.js +6 -0
- package/dist/gateway/static/root/assets/binary-plugins-7qs3qcW9.js +2 -0
- package/dist/gateway/static/root/assets/{block-editor-ClRFbHP7.js → block-editor-BFPUlxJ6.js} +28 -28
- package/dist/gateway/static/root/assets/{browser-automation-inputs-5B3qAdmb.js → browser-automation-inputs-BUAIKIX0.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BjMub7JM.js → browser-automations-page-CSwu1U1F.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-C1ReMNqX.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-BzWFO_x_.js +1 -0
- package/dist/gateway/static/root/assets/{capabilities-BKu9BqPe.js → capabilities-K0Zb_lH0.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-BdTSqloI.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-gZ8auLwa.js → capabilities-settings-panel-BUblBMZC.js} +4 -4
- package/dist/gateway/static/root/assets/{capability-header-actions-L1NvoOUG.js → capability-header-actions-AMn_vTNv.js} +1 -1
- package/dist/gateway/static/root/assets/channels-CXCf5qO6.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DsCpKPBe.js → chat-terminal-dock-C7nAROhF.js} +2 -2
- package/dist/gateway/static/root/assets/chevron-left-DqFhpbvK.js +1 -0
- package/dist/gateway/static/root/assets/computer-settings-page-B5SuSZ3G.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-mtH9mEBf.js → connector-service-page-CTx1B8wx.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DfnK1crf.js +2 -0
- package/dist/gateway/static/root/assets/date-formatters-CUZAyDEg.js +1 -0
- package/dist/gateway/static/root/assets/date-picker-Cx_xIKvN.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-B_fPQBTM.js → dependency-picker-DYm96PDu.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CJrO9Vd_.js → desktop-pet-D90OzgeR.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DYAfri9w.js → desktop-pet-settings-CmdCecjm.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CqRys2R8.js → device-pairing-wizard-s2ogSa4l.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-D7_qSxNZ.js → directory-picker-path-field-DZpaoeNa.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BGyJpRv4.js → extension-debug-page-Bv6QE8kC.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-D1zBmd8F.js → extension-page-CEsq71Cm.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-F9JzOWZ3.js → extension-provider-CX-sK0Tw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CTR8AjCG.js → extension-settings-page-UyOHF39P.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-Chhv4Nfv.js → fallback-models-CKv_Wqg8.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-CoRoOG1l.js → gateway-config-swr-Cjnkle5J.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-D0ygm6bc.js → gateway-realtime-DCCLdyQD.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-C_Th8kGg.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-CZ73IpbP.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-FDS6S6qa.js → gateway-startup-retry-CXKmdVzN.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BQWq4kYi.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BPd76jW5.js → image-generation-api-NLHzm4Nc.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-9EnECtcl.js → imports-page-C7qvlBTQ.js} +1 -1
- package/dist/gateway/static/root/assets/index-BQgqzhQj.js +106 -0
- package/dist/gateway/static/root/assets/index-COB4QIJp.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-MC7mG2h2.js → keyboard-shortcuts-settings-pkgFWJb-.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-dMDhZXAi.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-c3HncHZ3.js → local-apps-page-TpUAfOn2.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-Cvv7I0fw.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-DId6-v2R.js → locale-store-C8TMD2gn.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-B-Y9oZLh.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-B2lzsw6X.js +1 -0
- package/dist/gateway/static/root/assets/markdown-view-Dse7rkio.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-XLewwq2q.js → media-plugins-BZrnzaBM.js} +1 -1
- package/dist/gateway/static/root/assets/messages-Dy26npMy.js +3 -0
- package/dist/gateway/static/root/assets/{models-hub-cache-B9SKjidc.js → models-hub-cache-B1C86nRp.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-DL__qP6U.js +5 -0
- package/dist/gateway/static/root/assets/{notes-api-Byt65v3r.js → notes-api-DKiVeQKG.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-DTBbg9Hs.js +8 -0
- package/dist/gateway/static/root/assets/{oauth-api-BYsCbyGZ.js → oauth-api-BwpzpRwC.js} +1 -1
- package/dist/gateway/static/root/assets/open-route-MyZ2sB9C.js +1 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-RBp1QK0F.js → page-context-capture-button-Cxzd4QPB.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-CzaTnHeD.js +1 -0
- package/dist/gateway/static/root/assets/product-open-page-D4hoEWiu.js +1 -0
- package/dist/gateway/static/root/assets/product-preview-content-aR38El2E.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-D20QH4YB.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Bf3BIcT6.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-7F2WNEZC.js → registry-api-AdnxowbH.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CKxqncqW.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-B0c120iI.js → runtime-tools-settings-panel-CBN3raz1.js} +1 -1
- package/dist/gateway/static/root/assets/scenes-page-Cv_5ozfX.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-DQpQc9tH.js → schema-form-CxrMGsT9.js} +1 -1
- package/dist/gateway/static/root/assets/secret-input-D93UrW4C.js +1 -0
- package/dist/gateway/static/root/assets/{send-session-input-D1oc6BC6.js → send-session-input-CgOzhDZ0.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-N3N37MrR.js → session-api-_HIN8or3.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-CzCto5zT.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-DZcu6NLJ.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DazqeDQ7.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-GgBEp6O7.js → settings-page-D8Q3H3-o.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DvLMMiuS.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-TBBGJPfT.js → share-link-dialog-Dg5os066.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DyRLPsPv.js → share-preview-page-DMvohAyr.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-DU0fHP2G.js → shares-api-C96IO4qJ.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DJ1ME-XM.js → shares-settings-CsDATuCw.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-1Puv6wOz.js → skill-api-C10ML0CH.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-ClyFqHk7.js → skill-reload-api-DNbJzSfB.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-DObMKvA6.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel--yV67a8L.js → system-settings-panel-Bn3khdzb.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-BR2L1L8l.js +2 -0
- package/dist/gateway/static/root/assets/task-expandable-content-DL2Q2gre.js +1 -0
- package/dist/gateway/static/root/assets/{tasks-CH6KoBeY.js → tasks-DwKXgZ-I.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-OhcbFEUR.js → theme-store-DQ6KJa4l.js} +1 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-Ed8_GYUT.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-COLdiP_E.js → tunnel-api-D3X8jDwo.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-CtM5IfrL.js → usage-page-BqzRyyb9.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-veoM0dHn.js → use-autosave-CRFefpzO.js} +1 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-OLrvSjn5.js +2 -0
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-Bope6MW6.js → use-file-preview-expanded-CJvzfQvw.js} +2 -2
- package/dist/gateway/static/root/assets/user-model-page-CG6wqIKP.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CwD6a3KQ.js → voice-api-key-field-R9zNWYR_.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-Daexehmc.js → voice-config-api-DLudE9Rc.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-C9u7tuEc.js → work-discovery-overlay-DVmQrolV.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BMOBbf33.js → workflow-run-setup-panel-DEkmuD3T.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-pqCB3sh4.js +6 -0
- package/dist/gateway/static/root/assets/workspace-api-CdVUhyPo.js +2 -0
- package/dist/gateway/static/root/index.html +33 -31
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/automations.js +1 -0
- package/dist/packages/gateway-contract/src/home.js +14 -0
- package/dist/packages/gateway-contract/src/index.js +2 -0
- package/dist/packages/gateway-contract/src/notifications.js +2 -1
- package/dist/packages/gateway-contract/src/personal-proactivity.js +139 -0
- package/dist/packages/gateway-contract/src/session-input-command.js +1 -0
- package/dist/packages/image-providers/src/catalog.js +373 -0
- package/dist/packages/image-providers/src/execute.js +372 -0
- package/dist/packages/image-providers/src/http.js +94 -0
- package/dist/packages/image-providers/src/index.js +5 -0
- package/dist/packages/image-providers/src/types.d.ts +95 -0
- package/dist/packages/image-providers/src/validation.js +52 -0
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +35 -3
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/commands/command-registry.js +1 -1
- package/dist/src/agent/context/execution-context.js +1 -1
- package/dist/src/agent/context/project-context.js +4 -4
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/failover-error.d.ts +1 -1
- package/dist/src/agent/failover-error.js +7 -0
- package/dist/src/agent/image/generation/native-provider.d.ts +2 -0
- package/dist/src/agent/image/generation/native-provider.js +118 -0
- package/dist/src/agent/image/generation/openai-images-provider.d.ts +1 -1
- package/dist/src/agent/image/generation/openai-images-provider.js +48 -32
- package/dist/src/agent/image/generation/provider-registry.js +4 -13
- package/dist/src/agent/image/generation/providers/xopc-cloud.js +5 -34
- package/dist/src/agent/image/generation/runtime-types.d.ts +2 -4
- package/dist/src/agent/image/generation/runtime.js +28 -23
- package/dist/src/agent/image/generation/types.d.ts +3 -50
- package/dist/src/agent/image/generation/validation.d.ts +6 -0
- package/dist/src/agent/image/generation/validation.js +16 -0
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/prompt/voice-presentation.d.ts +1 -1
- package/dist/src/agent/prompt/voice-presentation.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +17 -1
- package/dist/src/agent/service.js +3 -3
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tools/delegation-parent-policy.js +2 -0
- package/dist/src/agent/tools/delegation-policy.js +2 -0
- package/dist/src/agent/tools/factory.d.ts +2 -0
- package/dist/src/agent/tools/factory.js +31 -4
- package/dist/src/agent/tools/image-generate-tool.js +5 -19
- package/dist/src/agent/tools/index.d.ts +2 -2
- package/dist/src/agent/tools/index.js +3 -3
- package/dist/src/agent/tools/knowledge-memory-tool.d.ts +2 -0
- package/dist/src/agent/tools/knowledge-memory-tool.js +60 -1
- package/dist/src/agent/tools/personal-attention-tool.d.ts +21 -0
- package/dist/src/agent/tools/personal-attention-tool.js +191 -0
- package/dist/src/agent/tools/personal-task-tool.d.ts +12 -8
- package/dist/src/agent/tools/personal-task-tool.js +35 -41
- package/dist/src/agent/tools/user-context-tool.d.ts +2 -0
- package/dist/src/agent/tools/user-context-tool.js +61 -2
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +1 -1
- package/dist/src/agent-catalog/repository.d.ts +1 -0
- package/dist/src/agent-catalog/repository.js +4 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.d.ts +2 -0
- package/dist/src/automations/domain/types.d.ts +1 -1
- package/dist/src/automations/domain/validation.d.ts +4 -0
- package/dist/src/automations/domain/validation.js +1 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-commands/personal-command-policy.d.ts +2 -0
- package/dist/src/chat-commands/personal-command-policy.js +9 -0
- package/dist/src/chat-commands/registry.js +6 -0
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/models.js +4 -9
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/models-json.d.ts +170 -0
- package/dist/src/config/models-json.js +23 -8
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/files/file-service.d.ts +6 -0
- package/dist/src/files/file-service.js +38 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/custom-image-providers.d.ts +34 -0
- package/dist/src/gateway/file-path-classifier.js +12 -3
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/files.js +13 -2
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/observability.js +8 -0
- package/dist/src/gateway/hono/routes/personal-agent.js +41 -0
- package/dist/src/gateway/hono/routes/projects.js +3 -3
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +9 -1
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +1 -0
- package/dist/src/gateway/service/agent-runner.js +12 -1
- package/dist/src/gateway/service/run-gateway-agent.d.ts +1 -0
- package/dist/src/gateway/service/run-gateway-agent.js +15 -0
- package/dist/src/gateway/service/session-command-service.js +5 -3
- package/dist/src/gateway/service/session-input-coordinator.d.ts +12 -0
- package/dist/src/gateway/service/session-input-coordinator.js +63 -5
- package/dist/src/gateway/service/sessions-api.js +1 -1
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +54 -9
- package/dist/src/gateway/session-context-summary.js +1 -1
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/local-apps/service.js +2 -2
- package/dist/src/notifications/planner.js +32 -0
- package/dist/src/notifications/service.d.ts +2 -0
- package/dist/src/personal-agent/capability-service.js +3 -2
- package/dist/src/personal-agent/communication.d.ts +3 -2
- package/dist/src/personal-agent/communication.js +4 -3
- package/dist/src/personal-agent/conversation-state.d.ts +5 -0
- package/dist/src/personal-agent/conversation-state.js +17 -0
- package/dist/src/personal-agent/notifications.d.ts +4 -0
- package/dist/src/personal-agent/notifications.js +40 -0
- package/dist/src/personal-agent/persona.d.ts +6 -0
- package/dist/src/personal-agent/persona.js +16 -0
- package/dist/src/personal-agent/policy.d.ts +3 -1
- package/dist/src/personal-agent/policy.js +28 -6
- package/dist/src/personal-agent/proactivity/automation.d.ts +3 -0
- package/dist/src/personal-agent/proactivity/automation.js +41 -0
- package/dist/src/personal-agent/proactivity/follow-up-request.d.ts +5 -0
- package/dist/src/personal-agent/proactivity/follow-up-request.js +44 -0
- package/dist/src/personal-agent/proactivity/repository.d.ts +128 -0
- package/dist/src/personal-agent/proactivity/repository.js +403 -0
- package/dist/src/personal-agent/proactivity/routes.d.ts +3 -0
- package/dist/src/personal-agent/proactivity/routes.js +182 -0
- package/dist/src/personal-agent/proactivity/service.d.ts +32 -0
- package/dist/src/personal-agent/proactivity/service.js +496 -0
- package/dist/src/personal-agent/prompt-context.d.ts +10 -0
- package/dist/src/personal-agent/prompt-context.js +119 -0
- package/dist/src/personal-agent/prompts.d.ts +7 -0
- package/dist/src/personal-agent/prompts.js +135 -0
- package/dist/src/personal-agent/reply-composer.d.ts +1 -1
- package/dist/src/personal-agent/reply-composer.js +41 -13
- package/dist/src/personal-agent/repository.d.ts +1 -1
- package/dist/src/personal-agent/repository.js +1 -1
- package/dist/src/personal-agent/request-delivery.js +1 -1
- package/dist/src/personal-agent/request-service.js +2 -2
- package/dist/src/personal-agent/service.d.ts +1 -2
- package/dist/src/personal-agent/service.js +5 -93
- package/dist/src/personal-agent/specialist-capabilities.d.ts +9 -0
- package/dist/src/personal-agent/specialist-capabilities.js +37 -0
- package/dist/src/personal-agent/unread.d.ts +10 -0
- package/dist/src/personal-agent/unread.js +43 -0
- package/dist/src/providers/env-keys.js +6 -0
- package/dist/src/providers/model-catalog-persistence.js +3 -22
- package/dist/src/providers/model-catalog-store.js +1 -8
- package/dist/src/providers/model-catalog-types.d.ts +1 -9
- package/dist/src/providers/xopc-cloud-model-source.js +4 -25
- package/dist/src/session/client-history.d.ts +2 -0
- package/dist/src/session/client-history.js +26 -0
- package/dist/src/session/init-session-turn.js +10 -0
- package/dist/src/session/session-context-for-llm.js +28 -0
- package/dist/src/session/store.js +1 -1
- package/dist/src/storage/sqlite/migrations/235_personal_conversation_priority.sql +3 -0
- package/dist/src/storage/sqlite/migrations/236_personal_proactivity.sql +53 -0
- package/dist/src/storage/sqlite/migrations/237_personal_strategy_versions.sql +18 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +2 -0
- package/dist/src/storage/sqlite/session-input-repository.js +18 -5
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/execution-context.js +1 -1
- package/dist/src/tasks/home-query-service.js +27 -1
- package/dist/src/tasks/task-main-update-decision-service.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/voice/platform-catalog.d.ts +1 -9
- package/dist/src/voice/realtime/agentEngine.js +32 -7
- package/dist/src/voice/realtime/engine.d.ts +1 -0
- package/dist/src/voice/realtime/omniEngine.d.ts +1 -0
- package/dist/src/voice/realtime/omniEngine.js +10 -0
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/runtime.d.ts +1 -0
- package/dist/src/voice/realtime/runtime.js +5 -0
- package/dist/src/voice/realtime/runtime.types.d.ts +2 -0
- package/dist/src/work-discovery/service.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +4 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-wYj-iyqv.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-C9HYMhnJ.js +0 -1
- package/dist/gateway/static/root/assets/agents-hPkFQ81z.js +0 -66
- package/dist/gateway/static/root/assets/app-link-DRL0YnPs.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-Ch0ViAJW.js +0 -7
- package/dist/gateway/static/root/assets/binary-plugins-J51oS7-D.js +0 -2
- package/dist/gateway/static/root/assets/browser-settings-page-CYrPA-Fp.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-CT_ZW9fT.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-dW6FXtOy.js +0 -2
- package/dist/gateway/static/root/assets/channels-Dx5T2G73.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-6FWwxYLe.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DgDLaws0.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-BDcwEaIx.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DBvCRclh.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BVfz4Tla.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BF_9C9yW.js +0 -1
- package/dist/gateway/static/root/assets/index-BpXej9jJ.js +0 -106
- package/dist/gateway/static/root/assets/index-CbJNcWAn.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CytNu0-_.js +0 -1
- package/dist/gateway/static/root/assets/local-session-drafts-gbemPamv.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-D4aXtitd.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-CRzWi_iJ.js +0 -1
- package/dist/gateway/static/root/assets/markdown-view-DQZ51j9e.js +0 -201
- package/dist/gateway/static/root/assets/messages-BHvpZNe9.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-BgbByI-4.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-R2BX5XCE.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-F0jTBWva.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-BtDK68qb.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-DmQEm0yH.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-CrLQvkHX.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C25_hQAd.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-DM64yMnx.js +0 -2
- package/dist/gateway/static/root/assets/secret-input-DPl3VYM8.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-CMGUwtbN.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-DvDO8LtA.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BNhgbmcX.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-10bMi6yL.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-D52pEr5x.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-D-tcS2bS.js +0 -2
- package/dist/gateway/static/root/assets/tracing-settings-page-DoBJ0TYY.js +0 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-DB0bBGzZ.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-CSh61kZ5.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-BrD9vXqO.js +0 -6
- package/dist/gateway/static/root/assets/workspace-api-Cs4sjV2A.js +0 -2
- package/dist/src/agent/image/generation/normalization.d.ts +0 -38
- package/dist/src/agent/image/generation/normalization.js +0 -181
- package/dist/src/agent/image/generation/providers/dashscope.d.ts +0 -35
- package/dist/src/agent/image/generation/providers/dashscope.js +0 -257
- package/dist/src/agent/image/generation/providers/fal.d.ts +0 -15
- package/dist/src/agent/image/generation/providers/fal.js +0 -323
- package/dist/src/agent/image/generation/providers/google.d.ts +0 -16
- package/dist/src/agent/image/generation/providers/google.js +0 -244
- package/dist/src/agent/image/generation/providers/minimax.d.ts +0 -23
- package/dist/src/agent/image/generation/providers/minimax.js +0 -215
- package/dist/src/agent/image/generation/providers/openai.d.ts +0 -5
- package/dist/src/agent/image/generation/providers/openai.js +0 -134
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
import { createLogger } from "../../../../utils/logger/index.js";
|
|
2
|
-
import { init_logger } from "../../../../utils/logger.js";
|
|
3
|
-
import { imageFileExtensionForMimeType } from "../image-assets.js";
|
|
4
|
-
import { pickTimeoutMsOrFallback } from "../../../../media-shared/http/deadline.js";
|
|
5
|
-
import { privateNetworkPolicyToSsrfGuardOptions } from "../../../../media-shared/http/private-network.js";
|
|
6
|
-
import { resolveProviderHttpRequestConfig } from "../../../../media-shared/http/resolve-provider-http-request-config.js";
|
|
7
|
-
import { postJsonRequest } from "../../../../media-shared/http/provider-http.js";
|
|
8
|
-
import "../../../../media-shared/http/index.js";
|
|
9
|
-
import { resolveApiKeyForProvider } from "../../../../providers/auth-runtime/resolve-api-key.js";
|
|
10
|
-
import { isProviderApiKeyConfigured } from "../../../../providers/auth-runtime/is-configured.js";
|
|
11
|
-
import "../../../../providers/auth-runtime/index.js";
|
|
12
|
-
//#region src/agent/image/generation/providers/fal.ts
|
|
13
|
-
/**
|
|
14
|
-
* Built-in Fal.ai image-generation provider.
|
|
15
|
-
*
|
|
16
|
-
* Fal.ai is queue-based:
|
|
17
|
-
* 1. POST https://queue.fal.run/<model> → { request_id, status_url, response_url }
|
|
18
|
-
* 2. GET status_url (poll) → { status: IN_QUEUE | IN_PROGRESS | COMPLETED | … }
|
|
19
|
-
* 3. GET response_url (after COMPLETED) → { images: [{ url, content_type, … }], … }
|
|
20
|
-
* 4. fetch each images[].url → bytes
|
|
21
|
-
*
|
|
22
|
-
* Auth: `Authorization: Key <FAL_KEY>` (Fal's REST convention).
|
|
23
|
-
* Configure via env `FAL_KEY` / `FAL_API_KEY` or the local credential store.
|
|
24
|
-
*
|
|
25
|
-
* Polling stays inside `req.timeoutMs` (default 600s for queue + inference);
|
|
26
|
-
* exceeding it surfaces a clear error rather than hanging forever.
|
|
27
|
-
*/
|
|
28
|
-
init_logger();
|
|
29
|
-
const log = createLogger("ImageGen:Fal");
|
|
30
|
-
const DEFAULT_FAL_QUEUE_BASE_URL = "https://queue.fal.run";
|
|
31
|
-
const FAL_DEFAULT_IMAGE_MODEL = "fal-ai/flux-2";
|
|
32
|
-
const DEFAULT_TIMEOUT_MS = 6e5;
|
|
33
|
-
const DEFAULT_POLL_INTERVAL_MS = 1500;
|
|
34
|
-
const MAX_POLL_INTERVAL_MS = 5e3;
|
|
35
|
-
const FAL_IMAGE_MODELS = [
|
|
36
|
-
FAL_DEFAULT_IMAGE_MODEL,
|
|
37
|
-
"fal-ai/flux-2-pro",
|
|
38
|
-
"fal-ai/nano-banana-2"
|
|
39
|
-
];
|
|
40
|
-
const FAL_CAPABILITIES = {
|
|
41
|
-
generate: {
|
|
42
|
-
maxCount: 4,
|
|
43
|
-
supportsSize: true,
|
|
44
|
-
supportsAspectRatio: true
|
|
45
|
-
},
|
|
46
|
-
edit: {
|
|
47
|
-
enabled: true,
|
|
48
|
-
maxInputImages: 4,
|
|
49
|
-
supportsSize: true,
|
|
50
|
-
supportsAspectRatio: true
|
|
51
|
-
},
|
|
52
|
-
geometry: {
|
|
53
|
-
sizes: [
|
|
54
|
-
"1024x1024",
|
|
55
|
-
"1024x1536",
|
|
56
|
-
"1536x1024",
|
|
57
|
-
"1024x1792",
|
|
58
|
-
"1792x1024"
|
|
59
|
-
],
|
|
60
|
-
aspectRatios: [
|
|
61
|
-
"1:1",
|
|
62
|
-
"16:9",
|
|
63
|
-
"9:16",
|
|
64
|
-
"4:3",
|
|
65
|
-
"3:4",
|
|
66
|
-
"21:9"
|
|
67
|
-
]
|
|
68
|
-
},
|
|
69
|
-
output: { formats: [
|
|
70
|
-
"png",
|
|
71
|
-
"jpeg",
|
|
72
|
-
"webp"
|
|
73
|
-
] }
|
|
74
|
-
};
|
|
75
|
-
function readFalCfgString(cfg, key) {
|
|
76
|
-
const providers = cfg?.providers;
|
|
77
|
-
if (!providers || typeof providers !== "object") return void 0;
|
|
78
|
-
const entry = providers["fal"];
|
|
79
|
-
if (!entry || typeof entry !== "object") return void 0;
|
|
80
|
-
const v = entry[key];
|
|
81
|
-
return typeof v === "string" && v.trim() ? v.trim() : void 0;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Resolve Fal queue base URL precedence:
|
|
85
|
-
* 1. cfg.providers.fal.baseUrl
|
|
86
|
-
* 2. FAL_QUEUE_BASE_URL / FAL_BASE_URL env
|
|
87
|
-
* 3. Default https://queue.fal.run
|
|
88
|
-
*/
|
|
89
|
-
function resolveFalBaseUrl(req) {
|
|
90
|
-
const fromCfg = readFalCfgString(req.cfg, "baseUrl");
|
|
91
|
-
if (fromCfg) return fromCfg.replace(/\/+$/, "");
|
|
92
|
-
const fromEnv = (process.env.FAL_QUEUE_BASE_URL ?? process.env.FAL_BASE_URL)?.trim();
|
|
93
|
-
if (fromEnv) return fromEnv.replace(/\/+$/, "");
|
|
94
|
-
return DEFAULT_FAL_QUEUE_BASE_URL;
|
|
95
|
-
}
|
|
96
|
-
function delay(ms, signal) {
|
|
97
|
-
return new Promise((resolve, reject) => {
|
|
98
|
-
if (signal?.aborted) {
|
|
99
|
-
reject(/* @__PURE__ */ new Error("Aborted"));
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const timer = setTimeout(() => {
|
|
103
|
-
signal?.removeEventListener("abort", onAbort);
|
|
104
|
-
resolve();
|
|
105
|
-
}, ms);
|
|
106
|
-
const onAbort = () => {
|
|
107
|
-
clearTimeout(timer);
|
|
108
|
-
reject(/* @__PURE__ */ new Error("Aborted"));
|
|
109
|
-
};
|
|
110
|
-
signal?.addEventListener("abort", onAbort, { once: true });
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
function buildFalRequestBody(req) {
|
|
114
|
-
const body = { prompt: req.prompt };
|
|
115
|
-
const count = Math.max(1, Math.min(4, req.count ?? 1));
|
|
116
|
-
if (count > 1) body.num_images = count;
|
|
117
|
-
if (req.size?.trim()) body.image_size = req.size.trim();
|
|
118
|
-
if (req.aspectRatio?.trim()) body.aspect_ratio = req.aspectRatio.trim();
|
|
119
|
-
if (req.outputFormat?.trim()) body.output_format = req.outputFormat.trim();
|
|
120
|
-
const inputs = req.inputImages ?? [];
|
|
121
|
-
if (inputs.length > 0) {
|
|
122
|
-
const dataUris = inputs.map((image) => {
|
|
123
|
-
return `data:${image.mimeType?.trim() || "image/png"};base64,${Buffer.from(image.buffer).toString("base64")}`;
|
|
124
|
-
});
|
|
125
|
-
if (dataUris.length === 1) body.image_url = dataUris[0];
|
|
126
|
-
else body.image_urls = dataUris;
|
|
127
|
-
}
|
|
128
|
-
const overrides = req.providerOptions?.fal;
|
|
129
|
-
if (overrides && typeof overrides === "object") Object.assign(body, overrides);
|
|
130
|
-
return body;
|
|
131
|
-
}
|
|
132
|
-
async function submitFalRequest(params) {
|
|
133
|
-
const { req, url, headers, httpDefaultTimeoutMs } = params;
|
|
134
|
-
const body = buildFalRequestBody(req);
|
|
135
|
-
log.debug({
|
|
136
|
-
providerId: "fal",
|
|
137
|
-
url,
|
|
138
|
-
model: req.model,
|
|
139
|
-
phase: "submit"
|
|
140
|
-
}, "Fal.ai queue submit");
|
|
141
|
-
const text = await (await postJsonRequest(url, {
|
|
142
|
-
label: "fal",
|
|
143
|
-
timeoutMs: pickTimeoutMsOrFallback(req.timeoutMs, httpDefaultTimeoutMs, DEFAULT_TIMEOUT_MS),
|
|
144
|
-
signal: req.signal,
|
|
145
|
-
body,
|
|
146
|
-
headers,
|
|
147
|
-
...privateNetworkPolicyToSsrfGuardOptions()
|
|
148
|
-
})).text();
|
|
149
|
-
let data;
|
|
150
|
-
try {
|
|
151
|
-
data = JSON.parse(text);
|
|
152
|
-
} catch {
|
|
153
|
-
throw new Error(`Fal.ai returned non-JSON on submit: ${text.slice(0, 240)}`);
|
|
154
|
-
}
|
|
155
|
-
if (!data.request_id) throw new Error(`Fal.ai submit missing request_id: ${text.slice(0, 240)}`);
|
|
156
|
-
return data;
|
|
157
|
-
}
|
|
158
|
-
async function pollFalStatus(params) {
|
|
159
|
-
const { statusUrl, headers, signal, deadlineEpochMs } = params;
|
|
160
|
-
let interval = DEFAULT_POLL_INTERVAL_MS;
|
|
161
|
-
while (true) {
|
|
162
|
-
if (Date.now() > deadlineEpochMs) throw new Error("Fal.ai request timed out while waiting for completion");
|
|
163
|
-
const res = await fetch(statusUrl, {
|
|
164
|
-
headers,
|
|
165
|
-
signal
|
|
166
|
-
});
|
|
167
|
-
if (!res.ok) {
|
|
168
|
-
const t = await res.text().catch(() => "");
|
|
169
|
-
throw new Error(`Fal.ai status check failed (${res.status}): ${t || res.statusText}`);
|
|
170
|
-
}
|
|
171
|
-
const text = await res.text();
|
|
172
|
-
let data;
|
|
173
|
-
try {
|
|
174
|
-
data = JSON.parse(text);
|
|
175
|
-
} catch {
|
|
176
|
-
throw new Error(`Fal.ai returned non-JSON on status: ${text.slice(0, 240)}`);
|
|
177
|
-
}
|
|
178
|
-
const status = (data.status || "").toUpperCase();
|
|
179
|
-
if (status === "COMPLETED") return data;
|
|
180
|
-
if (status && status !== "IN_QUEUE" && status !== "IN_PROGRESS") {
|
|
181
|
-
const errMsg = data.error || `unexpected status=${data.status ?? "<missing>"}`;
|
|
182
|
-
throw new Error(`Fal.ai request failed: ${errMsg}`);
|
|
183
|
-
}
|
|
184
|
-
await delay(interval, signal);
|
|
185
|
-
interval = Math.min(MAX_POLL_INTERVAL_MS, interval + 500);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
async function fetchFalResult(params) {
|
|
189
|
-
const { responseUrl, headers, signal } = params;
|
|
190
|
-
const res = await fetch(responseUrl, {
|
|
191
|
-
headers,
|
|
192
|
-
signal
|
|
193
|
-
});
|
|
194
|
-
if (!res.ok) {
|
|
195
|
-
const t = await res.text().catch(() => "");
|
|
196
|
-
throw new Error(`Fal.ai result fetch failed (${res.status}): ${t || res.statusText}`);
|
|
197
|
-
}
|
|
198
|
-
const text = await res.text();
|
|
199
|
-
let data;
|
|
200
|
-
try {
|
|
201
|
-
data = JSON.parse(text);
|
|
202
|
-
} catch {
|
|
203
|
-
throw new Error(`Fal.ai returned non-JSON on result: ${text.slice(0, 240)}`);
|
|
204
|
-
}
|
|
205
|
-
return data;
|
|
206
|
-
}
|
|
207
|
-
async function downloadFalImages(params) {
|
|
208
|
-
const { result, signal } = params;
|
|
209
|
-
const entries = result.images?.length ? result.images : result.image ? [result.image] : [];
|
|
210
|
-
if (entries.length === 0) throw new Error("Fal.ai returned no images");
|
|
211
|
-
const out = [];
|
|
212
|
-
let index = 0;
|
|
213
|
-
for (const entry of entries) {
|
|
214
|
-
if (!entry.url) continue;
|
|
215
|
-
index += 1;
|
|
216
|
-
const res = await fetch(entry.url, {
|
|
217
|
-
redirect: "follow",
|
|
218
|
-
signal
|
|
219
|
-
});
|
|
220
|
-
if (!res.ok) {
|
|
221
|
-
const t = await res.text().catch(() => "");
|
|
222
|
-
throw new Error(`Fal.ai image download failed (${res.status}): ${t || res.statusText}`);
|
|
223
|
-
}
|
|
224
|
-
const arrayBuffer = await res.arrayBuffer();
|
|
225
|
-
const buf = Buffer.from(arrayBuffer);
|
|
226
|
-
const mimeType = entry.content_type?.trim() || res.headers.get("content-type")?.split(";")[0]?.trim() || "image/png";
|
|
227
|
-
const ext = imageFileExtensionForMimeType(mimeType);
|
|
228
|
-
const fileName = entry.file_name?.trim() || `image-${index}.${ext}`;
|
|
229
|
-
out.push({
|
|
230
|
-
buffer: buf,
|
|
231
|
-
mimeType,
|
|
232
|
-
fileName
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
if (out.length === 0) throw new Error("Fal.ai returned image entries without URLs");
|
|
236
|
-
return out;
|
|
237
|
-
}
|
|
238
|
-
async function generateFalImages(params) {
|
|
239
|
-
const { req, apiKey } = params;
|
|
240
|
-
const baseUrl = resolveFalBaseUrl(req);
|
|
241
|
-
const model = req.model?.trim() || "fal-ai/flux-2";
|
|
242
|
-
const submitUrl = `${baseUrl}/${model}`;
|
|
243
|
-
const httpDefaults = resolveProviderHttpRequestConfig({
|
|
244
|
-
providerId: "fal",
|
|
245
|
-
cfg: req.cfg,
|
|
246
|
-
fallbackTimeoutMs: DEFAULT_TIMEOUT_MS
|
|
247
|
-
});
|
|
248
|
-
const headers = {
|
|
249
|
-
...httpDefaults.headers,
|
|
250
|
-
authorization: `Key ${apiKey}`
|
|
251
|
-
};
|
|
252
|
-
const totalDeadlineMs = req.timeoutMs ?? httpDefaults.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
253
|
-
const deadlineEpochMs = Date.now() + totalDeadlineMs;
|
|
254
|
-
const submit = await submitFalRequest({
|
|
255
|
-
req,
|
|
256
|
-
apiKey,
|
|
257
|
-
url: submitUrl,
|
|
258
|
-
headers,
|
|
259
|
-
httpDefaultTimeoutMs: httpDefaults.timeoutMs
|
|
260
|
-
});
|
|
261
|
-
const statusUrl = submit.status_url ?? `${submitUrl}/requests/${submit.request_id}/status`;
|
|
262
|
-
const responseUrl = submit.response_url ?? `${submitUrl}/requests/${submit.request_id}`;
|
|
263
|
-
log.debug({
|
|
264
|
-
providerId: "fal",
|
|
265
|
-
model,
|
|
266
|
-
requestId: submit.request_id,
|
|
267
|
-
statusUrl,
|
|
268
|
-
phase: "poll"
|
|
269
|
-
}, "Fal.ai polling for completion");
|
|
270
|
-
await pollFalStatus({
|
|
271
|
-
statusUrl,
|
|
272
|
-
headers,
|
|
273
|
-
signal: req.signal,
|
|
274
|
-
deadlineEpochMs
|
|
275
|
-
});
|
|
276
|
-
return {
|
|
277
|
-
images: await downloadFalImages({
|
|
278
|
-
result: await fetchFalResult({
|
|
279
|
-
responseUrl,
|
|
280
|
-
headers,
|
|
281
|
-
signal: req.signal
|
|
282
|
-
}),
|
|
283
|
-
signal: req.signal
|
|
284
|
-
}),
|
|
285
|
-
model
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
function buildFalImageGenerationProvider() {
|
|
289
|
-
return {
|
|
290
|
-
id: "fal",
|
|
291
|
-
label: "Fal.ai",
|
|
292
|
-
documentationUrl: "https://docs.fal.ai/",
|
|
293
|
-
apiKeyUrl: "https://fal.ai/dashboard/keys",
|
|
294
|
-
configFields: [{
|
|
295
|
-
key: "baseUrl",
|
|
296
|
-
label: "Base URL",
|
|
297
|
-
type: "url",
|
|
298
|
-
placeholder: "https://queue.fal.run"
|
|
299
|
-
}],
|
|
300
|
-
defaultModel: FAL_DEFAULT_IMAGE_MODEL,
|
|
301
|
-
models: [...FAL_IMAGE_MODELS],
|
|
302
|
-
capabilities: FAL_CAPABILITIES,
|
|
303
|
-
isConfigured: (ctx) => isProviderApiKeyConfigured({
|
|
304
|
-
providerId: "fal",
|
|
305
|
-
cfg: ctx.cfg,
|
|
306
|
-
agentId: ctx.agentId
|
|
307
|
-
}),
|
|
308
|
-
async generateImage(req) {
|
|
309
|
-
const apiKey = resolveApiKeyForProvider({
|
|
310
|
-
providerId: "fal",
|
|
311
|
-
cfg: req.cfg,
|
|
312
|
-
agentId: req.agentId
|
|
313
|
-
});
|
|
314
|
-
if (!apiKey) throw new Error("Fal.ai API key missing (set FAL_KEY / FAL_API_KEY or save a credential)");
|
|
315
|
-
return generateFalImages({
|
|
316
|
-
req,
|
|
317
|
-
apiKey
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
}
|
|
322
|
-
//#endregion
|
|
323
|
-
export { FAL_DEFAULT_IMAGE_MODEL, FAL_IMAGE_MODELS, buildFalImageGenerationProvider, generateFalImages, resolveFalBaseUrl };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ImageGenerationProvider, ImageGenerationRequest, ImageGenerationResult } from '../types.js';
|
|
2
|
-
/** Gemini image-capable model ids exposed by xopc. */
|
|
3
|
-
export declare const GOOGLE_IMAGE_MODELS: readonly string[];
|
|
4
|
-
export declare const GOOGLE_DEFAULT_IMAGE_MODEL: string;
|
|
5
|
-
/**
|
|
6
|
-
* Resolve Google Gemini base URL precedence:
|
|
7
|
-
* 1. cfg.providers.google.baseUrl
|
|
8
|
-
* 2. GEMINI_BASE_URL / GOOGLE_GENERATIVE_AI_BASE_URL env
|
|
9
|
-
* 3. Default https://generativelanguage.googleapis.com
|
|
10
|
-
*/
|
|
11
|
-
export declare function resolveGoogleBaseUrl(req: ImageGenerationRequest): string;
|
|
12
|
-
export declare function generateGoogleImages(params: {
|
|
13
|
-
req: ImageGenerationRequest;
|
|
14
|
-
apiKey: string;
|
|
15
|
-
}): Promise<ImageGenerationResult>;
|
|
16
|
-
export declare function buildGoogleImageGenerationProvider(): ImageGenerationProvider;
|
|
@@ -1,244 +0,0 @@
|
|
|
1
|
-
import { createLogger } from "../../../../utils/logger/index.js";
|
|
2
|
-
import { init_logger } from "../../../../utils/logger.js";
|
|
3
|
-
import { imageFileExtensionForMimeType } from "../image-assets.js";
|
|
4
|
-
import { pickTimeoutMsOrFallback } from "../../../../media-shared/http/deadline.js";
|
|
5
|
-
import { privateNetworkPolicyToSsrfGuardOptions } from "../../../../media-shared/http/private-network.js";
|
|
6
|
-
import { resolveProviderHttpRequestConfig } from "../../../../media-shared/http/resolve-provider-http-request-config.js";
|
|
7
|
-
import { postJsonRequest } from "../../../../media-shared/http/provider-http.js";
|
|
8
|
-
import "../../../../media-shared/http/index.js";
|
|
9
|
-
import { resolveApiKeyForProvider } from "../../../../providers/auth-runtime/resolve-api-key.js";
|
|
10
|
-
import { isProviderApiKeyConfigured } from "../../../../providers/auth-runtime/is-configured.js";
|
|
11
|
-
import "../../../../providers/auth-runtime/index.js";
|
|
12
|
-
//#region src/agent/image/generation/providers/google.ts
|
|
13
|
-
/**
|
|
14
|
-
* Built-in Google Gemini image-generation provider.
|
|
15
|
-
*
|
|
16
|
-
* Uses the Gemini `generateContent` REST surface
|
|
17
|
-
* (`https://generativelanguage.googleapis.com/v1beta/models/<model>:generateContent`)
|
|
18
|
-
* with `responseModalities: ['TEXT', 'IMAGE']`, accepting Buffer-encoded
|
|
19
|
-
* `inlineData` parts back. Supports both text-to-image (no inputImages) and
|
|
20
|
-
* image-editing (one or more inputImages, sent as additional inlineData parts).
|
|
21
|
-
*
|
|
22
|
-
* Authentication: prefers `?key=<API_KEY>` query (the canonical Gemini surface);
|
|
23
|
-
* falls back to `Authorization: Bearer` when the user explicitly configures an
|
|
24
|
-
* OAuth-style key. Configure via env `GOOGLE_API_KEY` /
|
|
25
|
-
* `GEMINI_API_KEY` / `GENERATIVE_LANGUAGE_API_KEY`, or via
|
|
26
|
-
* the local credential store.
|
|
27
|
-
*/
|
|
28
|
-
init_logger();
|
|
29
|
-
const log = createLogger("ImageGen:Google");
|
|
30
|
-
const DEFAULT_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com";
|
|
31
|
-
const DEFAULT_GEMINI_API_VERSION = "v1beta";
|
|
32
|
-
const DEFAULT_TIMEOUT_MS = 18e4;
|
|
33
|
-
/** Gemini image-capable model ids exposed by xopc. */
|
|
34
|
-
const GOOGLE_IMAGE_MODELS = [
|
|
35
|
-
"gemini-3.1-flash-image",
|
|
36
|
-
"gemini-3.1-flash-lite-image",
|
|
37
|
-
"gemini-3-pro-image"
|
|
38
|
-
];
|
|
39
|
-
const GOOGLE_DEFAULT_IMAGE_MODEL = GOOGLE_IMAGE_MODELS[0];
|
|
40
|
-
const GOOGLE_CAPABILITIES = {
|
|
41
|
-
generate: {
|
|
42
|
-
maxCount: 4,
|
|
43
|
-
supportsSize: true,
|
|
44
|
-
supportsAspectRatio: true
|
|
45
|
-
},
|
|
46
|
-
edit: {
|
|
47
|
-
enabled: true,
|
|
48
|
-
maxInputImages: 5,
|
|
49
|
-
supportsSize: true,
|
|
50
|
-
supportsAspectRatio: true
|
|
51
|
-
},
|
|
52
|
-
geometry: {
|
|
53
|
-
sizes: [
|
|
54
|
-
"1024x1024",
|
|
55
|
-
"1024x1536",
|
|
56
|
-
"1536x1024",
|
|
57
|
-
"1024x1792",
|
|
58
|
-
"1792x1024"
|
|
59
|
-
],
|
|
60
|
-
aspectRatios: [
|
|
61
|
-
"1:1",
|
|
62
|
-
"2:3",
|
|
63
|
-
"3:2",
|
|
64
|
-
"3:4",
|
|
65
|
-
"4:3",
|
|
66
|
-
"4:5",
|
|
67
|
-
"5:4",
|
|
68
|
-
"9:16",
|
|
69
|
-
"16:9",
|
|
70
|
-
"21:9"
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
|
-
output: { formats: [
|
|
74
|
-
"png",
|
|
75
|
-
"jpeg",
|
|
76
|
-
"webp"
|
|
77
|
-
] }
|
|
78
|
-
};
|
|
79
|
-
function readGoogleCfgString(cfg, key) {
|
|
80
|
-
const providers = cfg?.providers;
|
|
81
|
-
if (!providers || typeof providers !== "object") return void 0;
|
|
82
|
-
const entry = providers["google"];
|
|
83
|
-
if (!entry || typeof entry !== "object") return void 0;
|
|
84
|
-
const v = entry[key];
|
|
85
|
-
return typeof v === "string" && v.trim() ? v.trim() : void 0;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Resolve Google Gemini base URL precedence:
|
|
89
|
-
* 1. cfg.providers.google.baseUrl
|
|
90
|
-
* 2. GEMINI_BASE_URL / GOOGLE_GENERATIVE_AI_BASE_URL env
|
|
91
|
-
* 3. Default https://generativelanguage.googleapis.com
|
|
92
|
-
*/
|
|
93
|
-
function resolveGoogleBaseUrl(req) {
|
|
94
|
-
const fromCfg = readGoogleCfgString(req.cfg, "baseUrl");
|
|
95
|
-
if (fromCfg) return fromCfg.replace(/\/+$/, "");
|
|
96
|
-
const fromEnv = (process.env.GEMINI_BASE_URL ?? process.env.GOOGLE_GENERATIVE_AI_BASE_URL)?.trim();
|
|
97
|
-
if (fromEnv) return fromEnv.replace(/\/+$/, "");
|
|
98
|
-
return DEFAULT_GEMINI_BASE_URL;
|
|
99
|
-
}
|
|
100
|
-
function resolveGoogleApiVersion(req) {
|
|
101
|
-
const fromCfg = readGoogleCfgString(req.cfg, "apiVersion");
|
|
102
|
-
if (fromCfg) return fromCfg;
|
|
103
|
-
const fromEnv = process.env.GEMINI_API_VERSION?.trim();
|
|
104
|
-
if (fromEnv) return fromEnv;
|
|
105
|
-
return DEFAULT_GEMINI_API_VERSION;
|
|
106
|
-
}
|
|
107
|
-
function resolveGoogleAuthMode(req) {
|
|
108
|
-
const v = (readGoogleCfgString(req.cfg, "authMode") ?? process.env.GEMINI_AUTH_MODE ?? "").trim().toLowerCase();
|
|
109
|
-
if (v === "bearer" || v === "oauth") return "bearer";
|
|
110
|
-
return "query";
|
|
111
|
-
}
|
|
112
|
-
function extractInlineData(part) {
|
|
113
|
-
if (part && typeof part === "object") {
|
|
114
|
-
if ("inlineData" in part && part.inlineData) return part.inlineData;
|
|
115
|
-
if ("inline_data" in part && part.inline_data) return part.inline_data;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
async function generateGoogleImages(params) {
|
|
119
|
-
const { req, apiKey } = params;
|
|
120
|
-
const model = req.model?.trim() || GOOGLE_DEFAULT_IMAGE_MODEL;
|
|
121
|
-
const apiVersion = resolveGoogleApiVersion(req);
|
|
122
|
-
const baseUrl = resolveGoogleBaseUrl(req);
|
|
123
|
-
const authMode = resolveGoogleAuthMode(req);
|
|
124
|
-
const userParts = [{ text: req.prompt }];
|
|
125
|
-
for (const image of req.inputImages ?? []) {
|
|
126
|
-
const mimeType = image.mimeType?.trim() || "image/png";
|
|
127
|
-
userParts.push({ inlineData: {
|
|
128
|
-
mimeType,
|
|
129
|
-
data: Buffer.from(image.buffer).toString("base64")
|
|
130
|
-
} });
|
|
131
|
-
}
|
|
132
|
-
const generationConfig = { responseModalities: ["TEXT", "IMAGE"] };
|
|
133
|
-
const imageConfig = {};
|
|
134
|
-
if (req.aspectRatio?.trim()) imageConfig.aspectRatio = req.aspectRatio.trim();
|
|
135
|
-
if (req.size?.trim()) imageConfig.size = req.size.trim();
|
|
136
|
-
if (req.outputFormat?.trim()) imageConfig.outputFormat = req.outputFormat.trim();
|
|
137
|
-
if (Object.keys(imageConfig).length > 0) generationConfig.imageConfig = imageConfig;
|
|
138
|
-
const candidateCount = Math.max(1, Math.min(4, req.count ?? 1));
|
|
139
|
-
if (candidateCount > 1) generationConfig.candidateCount = candidateCount;
|
|
140
|
-
const body = {
|
|
141
|
-
contents: [{
|
|
142
|
-
role: "user",
|
|
143
|
-
parts: userParts
|
|
144
|
-
}],
|
|
145
|
-
generationConfig
|
|
146
|
-
};
|
|
147
|
-
const baseEndpoint = `${baseUrl}/${apiVersion}/models/${encodeURIComponent(model)}:generateContent`;
|
|
148
|
-
const url = authMode === "query" ? `${baseEndpoint}?key=${encodeURIComponent(apiKey)}` : baseEndpoint;
|
|
149
|
-
const httpDefaults = resolveProviderHttpRequestConfig({
|
|
150
|
-
providerId: "google",
|
|
151
|
-
cfg: req.cfg,
|
|
152
|
-
fallbackTimeoutMs: DEFAULT_TIMEOUT_MS
|
|
153
|
-
});
|
|
154
|
-
const headers = { ...httpDefaults.headers };
|
|
155
|
-
if (authMode === "bearer") headers.authorization = `Bearer ${apiKey}`;
|
|
156
|
-
log.debug({
|
|
157
|
-
providerId: "google",
|
|
158
|
-
model,
|
|
159
|
-
url: baseEndpoint,
|
|
160
|
-
authMode,
|
|
161
|
-
candidateCount,
|
|
162
|
-
inputImages: (req.inputImages ?? []).length,
|
|
163
|
-
phase: "request"
|
|
164
|
-
}, "Google Gemini image generation request");
|
|
165
|
-
const rawText = await (await postJsonRequest(url, {
|
|
166
|
-
label: "google",
|
|
167
|
-
timeoutMs: pickTimeoutMsOrFallback(req.timeoutMs, httpDefaults.timeoutMs, DEFAULT_TIMEOUT_MS),
|
|
168
|
-
signal: req.signal,
|
|
169
|
-
body,
|
|
170
|
-
headers,
|
|
171
|
-
...privateNetworkPolicyToSsrfGuardOptions()
|
|
172
|
-
})).text();
|
|
173
|
-
let data;
|
|
174
|
-
try {
|
|
175
|
-
data = JSON.parse(rawText);
|
|
176
|
-
} catch {
|
|
177
|
-
throw new Error(`Google Gemini returned non-JSON: ${rawText.slice(0, 240)}`);
|
|
178
|
-
}
|
|
179
|
-
if (data.error) {
|
|
180
|
-
const code = data.error.code ?? data.error.status ?? "UNKNOWN";
|
|
181
|
-
throw new Error(`Google Gemini: ${code}: ${data.error.message ?? "request failed"}`);
|
|
182
|
-
}
|
|
183
|
-
if (data.promptFeedback?.blockReason) throw new Error(`Google Gemini blocked prompt: ${data.promptFeedback.blockReason}`);
|
|
184
|
-
const collected = [];
|
|
185
|
-
let index = 0;
|
|
186
|
-
for (const candidate of data.candidates ?? []) for (const part of candidate.content?.parts ?? []) {
|
|
187
|
-
const inline = extractInlineData(part);
|
|
188
|
-
if (!inline?.data) continue;
|
|
189
|
-
const mimeType = inline.mimeType?.trim() || "image/png";
|
|
190
|
-
const buffer = Buffer.from(inline.data, "base64");
|
|
191
|
-
if (buffer.length === 0) continue;
|
|
192
|
-
index += 1;
|
|
193
|
-
const ext = imageFileExtensionForMimeType(mimeType);
|
|
194
|
-
collected.push({
|
|
195
|
-
buffer,
|
|
196
|
-
mimeType,
|
|
197
|
-
fileName: `image-${index}.${ext}`
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
if (collected.length === 0) {
|
|
201
|
-
const finishReason = data.candidates?.[0]?.finishReason ?? "unknown";
|
|
202
|
-
throw new Error(`Google Gemini returned no image data (finishReason=${finishReason}). Verify the model id supports image output.`);
|
|
203
|
-
}
|
|
204
|
-
return {
|
|
205
|
-
images: collected,
|
|
206
|
-
model
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
function buildGoogleImageGenerationProvider() {
|
|
210
|
-
return {
|
|
211
|
-
id: "google",
|
|
212
|
-
label: "Google Gemini",
|
|
213
|
-
documentationUrl: "https://ai.google.dev/gemini-api/docs/image-generation",
|
|
214
|
-
apiKeyUrl: "https://aistudio.google.com/app/apikey",
|
|
215
|
-
configFields: [{
|
|
216
|
-
key: "baseUrl",
|
|
217
|
-
label: "Base URL",
|
|
218
|
-
type: "url",
|
|
219
|
-
placeholder: "https://generativelanguage.googleapis.com"
|
|
220
|
-
}],
|
|
221
|
-
defaultModel: GOOGLE_DEFAULT_IMAGE_MODEL,
|
|
222
|
-
models: [...GOOGLE_IMAGE_MODELS],
|
|
223
|
-
capabilities: GOOGLE_CAPABILITIES,
|
|
224
|
-
isConfigured: (ctx) => isProviderApiKeyConfigured({
|
|
225
|
-
providerId: "google",
|
|
226
|
-
cfg: ctx.cfg,
|
|
227
|
-
agentId: ctx.agentId
|
|
228
|
-
}),
|
|
229
|
-
async generateImage(req) {
|
|
230
|
-
const apiKey = resolveApiKeyForProvider({
|
|
231
|
-
providerId: "google",
|
|
232
|
-
cfg: req.cfg,
|
|
233
|
-
agentId: req.agentId
|
|
234
|
-
});
|
|
235
|
-
if (!apiKey) throw new Error("Google Gemini API key missing (set GOOGLE_API_KEY / GEMINI_API_KEY or save a credential)");
|
|
236
|
-
return generateGoogleImages({
|
|
237
|
-
req,
|
|
238
|
-
apiKey
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
//#endregion
|
|
244
|
-
export { GOOGLE_DEFAULT_IMAGE_MODEL, GOOGLE_IMAGE_MODELS, buildGoogleImageGenerationProvider, generateGoogleImages, resolveGoogleBaseUrl };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ImageGenerationProvider, ImageGenerationRequest, ImageGenerationResult } from '../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* MiniMax `POST /v1/image_generation` model names (vendor OpenAPI enum).
|
|
4
|
-
* Default: `image-01`. `image-01-live` is the alternate enum value on the same API.
|
|
5
|
-
* @see https://platform.minimax.io/docs/api-reference/image-generation-i2i
|
|
6
|
-
*/
|
|
7
|
-
export declare const MINIMAX_IMAGE_MODELS: readonly string[];
|
|
8
|
-
export declare const MINIMAX_DEFAULT_IMAGE_MODEL: string;
|
|
9
|
-
/**
|
|
10
|
-
* Resolve MiniMax base URL:
|
|
11
|
-
* 1. cfg.providers[providerId].baseUrl
|
|
12
|
-
* 2. MINIMAX_BASE_URL env
|
|
13
|
-
* 3. Provider default base URL
|
|
14
|
-
*/
|
|
15
|
-
export declare function resolveMinimaxBaseUrl(req: ImageGenerationRequest): string;
|
|
16
|
-
export type MinimaxAspectRatio = '1:1' | '16:9' | '9:16' | '4:3' | '3:4';
|
|
17
|
-
/** Map tool size (e.g. `1024x1024`) to the closest MiniMax-supported aspect ratio. */
|
|
18
|
-
export declare function mapSizeToMinimaxAspectRatio(size?: string): MinimaxAspectRatio;
|
|
19
|
-
export declare function generateMinimaxImages(params: {
|
|
20
|
-
req: ImageGenerationRequest;
|
|
21
|
-
apiKey: string;
|
|
22
|
-
}): Promise<ImageGenerationResult>;
|
|
23
|
-
export declare function buildMinimaxImageGenerationProvider(): ImageGenerationProvider;
|