@xopcai/xopc 0.0.355 → 0.0.357
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/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-X7CG9pzB.js → activity-store-Bj0GuUUk.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DiEBNuSv.js → agent-avatar-dicebear-5q-LyRB2.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DpBmB3QX.js → agent-defaults-settings-panel-BOojrPNq.js} +1 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-3fkKAT0r.js +1 -0
- package/dist/gateway/static/root/assets/agents-DJyRK5vN.js +66 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-Ck2x78jq.js → agents-admin-api-CYqmO7gb.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-MkSa6isi.js → app-management-settings-panel-8ODazg-Y.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B7hCkaT_.js → appearance-settings-0G9nGAsa.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-D_CduJuC.js → apps-page-CJyfU05v.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-QfOaQPL_.js → archive-plugin-BZHSbFiu.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-uEnQawd7.js → automations-page-egZn4y94.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CI1EK1eb.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BF2lVwR9.js → binary-plugins-x2-RmzUs.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-r4mKGacz.js → block-editor-Bi-NBvGE.js} +39 -39
- package/dist/gateway/static/root/assets/{browser-automation-inputs-FW3bYZ-z.js → browser-automation-inputs-uQ2AGFFU.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-Blrxyy_h.js → browser-automations-page-D2AYNyC2.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-DGuwrO7j.js → browser-settings-page-DVMJRsch.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-CF4-mrIa.js → capabilities-Btku0cS3.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BCF_160Z.js → capabilities-Cl1RErL_.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-CBdEzKy1.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-B7f1WLgL.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-CyvI2F5x.js → capability-header-actions-BuYo4ONV.js} +1 -1
- package/dist/gateway/static/root/assets/channels-COGpGGqA.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-YdxhecE7.js → chat-terminal-dock-DJnrcf3F.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-BuCrA8yD.js → computer-settings-page-CbKp1tj0.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BiB2GYkp.js → connector-service-page-BxJquXDl.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DJocZ_mY.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-BJtADyRQ.js → date-picker-CYQyKepm.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-D-Ko0G40.js → dependency-picker-dc-q0G_j.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CVPWcWwC.js → desktop-pet-gvvvaJ51.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BcN_I-7y.js → desktop-pet-settings-w8qYvD9r.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-CAQ2qJIZ.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-m0CubGEP.js → directory-picker-path-field-BfJOJnPB.js} +1 -1
- package/dist/gateway/static/root/assets/dist-C3DSFZCi.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BrGWLJg9.js → extension-debug-page-DPc3vTw0.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Dd88ynHj.js → extension-page-BpyU7d5e.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-CUpbXB2k.js → extension-provider-D-0AeFhE.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Dq1MXh6D.js → extension-settings-page-BlzNJ6hK.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-B31I6Gbq.js → gateway-config-swr-Da3Oob_s.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-D6ffOiPe.js → gateway-realtime-BDh3i8n7.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-B5Oq6VCQ.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-C_bTRQeE.js → gateway-settings-DyreTpro.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DVol958v.js → gateway-startup-retry-BEj_bcbm.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-rKyHpQpb.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-TVgJfz9r.js → image-generation-api-8jfU8AlD.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-Cd4tcbLU.js → imports-page-BHUlyE3u.js} +1 -1
- package/dist/gateway/static/root/assets/index-DOFuObNM.js +106 -0
- package/dist/gateway/static/root/assets/index-DUgsBdV3.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CmalfzgQ.js → keyboard-shortcuts-settings-Pb-3Ryr9.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-BquHHLj6.js → local-app-workbench-page-yWS0QdRe.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-RPLHMvYs.js → local-apps-page-DgQHDdZh.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-wiq_12oN.js → local-session-drafts-jOqfUlwj.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-Y1aBayM_.js → locale-store-DodizOrj.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-7NMGltSw.js → logs-page-CwTIW0J0.js} +2 -2
- package/dist/gateway/static/root/assets/loopi-C09I2mNj.css +1 -0
- package/dist/gateway/static/root/assets/loopi-Djb8XU3l.js +1 -0
- package/dist/gateway/static/root/assets/{management-settings-zwFewbhp.js → management-settings-Dm2Fa1QY.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-7tzqIp_G.js → markdown-view-Bb6ohqHz.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-cjgrKnne.js → media-plugins-DIhqKSK5.js} +1 -1
- package/dist/gateway/static/root/assets/messages-D8PmAUB-.js +3 -0
- package/dist/gateway/static/root/assets/models-hub-cache-CaYi043g.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-D9iPUCQq.js +5 -0
- package/dist/gateway/static/root/assets/{notes-api-J0yhflxC.js → notes-api-DYfvIxWh.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-CbzhN_on.js +8 -0
- package/dist/gateway/static/root/assets/{oauth-api-CYe61zfD.js → oauth-api-gSu-iTk5.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-DqmAq4Ov.js → page-context-capture-button-B6i0R1qQ.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-DopSoSDc.js +1 -0
- package/dist/gateway/static/root/assets/{popover-select-DcsFzD_i.js → popover-select-BNZZDJpO.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-SsG2sljT.js → product-open-page-CMmB1iyB.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-wp5cFhM7.js → project-detail-page-BrGdrlhx.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-Brfi519S.js → projects-page-CmjHjX8D.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-DqDOrPQ0.js → registry-api-D0eYNizR.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-WKPLG5V4.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-CT6HKczq.js → runtime-tools-settings-panel-D1IEye-5.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-BmlI42OR.js → scenes-page-CDxjO8IH.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-DEcsbgne.js → schema-form-DrSp5o9r.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-C7Nqy0sK.js → send-session-input-DstpmO44.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CTN4qwiN.js → session-api-qy4gMa5t.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-DsH1DZI_.js → session-manager-CFqOuGy-.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-tL7mZG6X.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-Dq5CfiKV.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-P50kLPUz.js → settings-page-CLx4gCfD.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DtnwH0wN.js → setup-status-panel-TBkyBEiM.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-COlX10Dc.js → share-link-dialog-B3Io5mOY.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-NtRLUieq.js → share-preview-page-BpZqXsgR.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-DICV5EKH.js → shares-api-BNNaREyB.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Bz0BI8lL.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-CcdHQhxd.js → skill-api-Bom72qsC.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-CWH3Fmx4.js → skill-reload-api-Dm6GgUYK.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-BIQrMkmI.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-DAR0w3Xi.js → system-settings-panel-CzAezoel.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-GOqAjMLD.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-BKgBPLH4.js → theme-store-AXut7b8R.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CBy97LfF.js → tunnel-api-DtkDWId1.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-BdX6VPQC.js → usage-page-ZKtrJ73f.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-Cn6hqqyM.js → use-autosave-BT3l-ETP.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-DL61XeSu.js → use-composer-attachments-zfL8zvRu.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-Cl9mU32w.js → use-file-preview-expanded-C4bBXf4j.js} +2 -2
- package/dist/gateway/static/root/assets/user-model-page-B6E9ihaw.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-Bw05QB_V.js → voice-api-key-field-BF9hOZ_1.js} +1 -1
- package/dist/gateway/static/root/assets/voice-config-api-D8G4fALX.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-overlay-cD0OrAiy.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BQ3fmhM-.js → workflow-run-setup-panel-4yISOYK9.js} +2 -2
- package/dist/gateway/static/root/assets/{workflows-page-Bl8rd4fM.js → workflows-page-B2_1T6js.js} +3 -3
- package/dist/gateway/static/root/assets/{workspace-api-BbBT75Kg.js → workspace-api-C4q2GwGV.js} +2 -2
- package/dist/gateway/static/root/index.html +32 -30
- package/dist/package.js +1 -1
- package/dist/packages/realtime-protocol/src/voice-catalog.js +4 -1
- package/dist/src/agent/agent-manager.js +3 -3
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/service.js +2 -2
- package/dist/src/agent/skills/hub-lock.js +1 -1
- 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/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-config/schema.d.ts +15 -0
- package/dist/src/agent-config/schema.js +5 -0
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- 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/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/models.js +18 -0
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/personal-agent.js +118 -6
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/voice.js +26 -1
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/security/gateway-scopes.js +2 -0
- package/dist/src/gateway/service.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +2 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +105 -9
- package/dist/src/gateway/xopc-cloud-onboarding.d.ts +3 -0
- package/dist/src/gateway/xopc-cloud-onboarding.js +27 -0
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/personal-agent/onboarding.d.ts +27 -0
- package/dist/src/personal-agent/onboarding.js +48 -0
- package/dist/src/personal-agent/repository.d.ts +6 -1
- package/dist/src/personal-agent/repository.js +7 -2
- package/dist/src/personal-agent/service.d.ts +31 -8
- package/dist/src/personal-agent/service.js +24 -13
- package/dist/src/providers/model-catalog-persistence.js +2 -2
- package/dist/src/storage/sqlite/migrations/230_personal_agent_onboarding.sql +8 -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/tasks/capabilities/read.js +2 -2
- package/dist/src/tui/backends/embedded-backend.js +2 -2
- package/dist/src/voice/language-profile.js +1 -1
- package/dist/src/voice/metadata/builtin.js +16 -39
- package/dist/src/voice/metadata/types.d.ts +2 -0
- package/dist/src/voice/platform-catalog.d.ts +3 -0
- package/dist/src/voice/realtime/agentEngine.js +30 -11
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/runtime.js +16 -1
- package/dist/src/voice/stt/providers/alibaba-transcription.js +3 -3
- package/dist/src/voice/stt/types.js +1 -1
- package/dist/src/voice/tts/providers/alibaba-speech.js +4 -16
- package/dist/src/voice/tts/providers/alibaba-voices.d.ts +3 -0
- package/dist/src/voice/tts/providers/alibaba-voices.js +197 -0
- package/dist/src/voice/tts/speech-provider-types.d.ts +1 -0
- package/dist/src/voice/tts/types.js +1 -1
- package/package.json +7 -7
- package/dist/gateway/static/root/assets/agent-plugin-dialog-DlojWUY_.js +0 -1
- package/dist/gateway/static/root/assets/agents-CeSCdUHP.js +0 -66
- package/dist/gateway/static/root/assets/automations-workspace-pdiSK3Qk.js +0 -7
- package/dist/gateway/static/root/assets/capabilities-page-DUIA2K--.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CwPNQsJS.js +0 -8
- package/dist/gateway/static/root/assets/channels-DBxDJV8I.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-nQAgZk-5.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-CoKKoUlt.js +0 -1
- package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DQuFWNjA.js +0 -1
- package/dist/gateway/static/root/assets/home-page-xbqSikkK.js +0 -1
- package/dist/gateway/static/root/assets/index-BuzC93X-.css +0 -1
- package/dist/gateway/static/root/assets/index-CYeGnj-L.js +0 -106
- package/dist/gateway/static/root/assets/messages-DPw2X06D.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-HGrORbzR.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-CwMg9cvF.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CWJwrvo7.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-Bbgx_dgV.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BdtF8Cvk.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-C_G8fZwV.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CDxdzwDs.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-7Ak_MsJg.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-ChjXDxdX.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-DEx0kXDV.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-CRxiQnWG.js +0 -2
- package/dist/gateway/static/root/assets/voice-config-api-BM75K3mR.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-DvwmD9Ma.js +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const PersonalOnboardingStepSchema: z.ZodEnum<{
|
|
3
|
+
voice: "voice";
|
|
4
|
+
identity: "identity";
|
|
5
|
+
intro: "intro";
|
|
6
|
+
connections: "connections";
|
|
7
|
+
}>;
|
|
8
|
+
export declare const PersonalOnboardingDraftSchema: z.ZodObject<{
|
|
9
|
+
displayName: z.ZodDefault<z.ZodString>;
|
|
10
|
+
appearance: z.ZodDefault<z.ZodEnum<{
|
|
11
|
+
loopi: "loopi";
|
|
12
|
+
"loopi-curious": "loopi-curious";
|
|
13
|
+
"loopi-care": "loopi-care";
|
|
14
|
+
}>>;
|
|
15
|
+
voice: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
export type PersonalOnboardingDraft = z.infer<typeof PersonalOnboardingDraftSchema>;
|
|
18
|
+
export type PersonalOnboardingStep = z.infer<typeof PersonalOnboardingStepSchema>;
|
|
19
|
+
export declare function getPersonalOnboarding(ownerId: string): {
|
|
20
|
+
step: PersonalOnboardingStep;
|
|
21
|
+
draft: PersonalOnboardingDraft;
|
|
22
|
+
completed: boolean;
|
|
23
|
+
welcomeDone: boolean;
|
|
24
|
+
};
|
|
25
|
+
export declare function savePersonalOnboarding(ownerId: string, step: PersonalOnboardingStep, draft: PersonalOnboardingDraft): void;
|
|
26
|
+
export declare function completePersonalOnboarding(ownerId: string): void;
|
|
27
|
+
export declare function finishPersonalWelcome(ownerId: string): void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/personal-agent/onboarding.ts
|
|
4
|
+
init_transaction();
|
|
5
|
+
const PersonalOnboardingStepSchema = z.enum([
|
|
6
|
+
"intro",
|
|
7
|
+
"identity",
|
|
8
|
+
"voice",
|
|
9
|
+
"connections"
|
|
10
|
+
]);
|
|
11
|
+
const PersonalOnboardingDraftSchema = z.object({
|
|
12
|
+
displayName: z.string().trim().min(1).max(60).default("Ada"),
|
|
13
|
+
appearance: z.enum([
|
|
14
|
+
"loopi",
|
|
15
|
+
"loopi-curious",
|
|
16
|
+
"loopi-care"
|
|
17
|
+
]).default("loopi"),
|
|
18
|
+
voice: z.string().trim().min(1).max(200).nullable().default(null)
|
|
19
|
+
}).strict();
|
|
20
|
+
function getPersonalOnboarding(ownerId) {
|
|
21
|
+
const row = getSqliteDatabase().prepare(`SELECT step, draft_json, completed_at, welcome_finished_at
|
|
22
|
+
FROM personal_agent_onboarding WHERE owner_id = ?`).get(ownerId);
|
|
23
|
+
return {
|
|
24
|
+
step: PersonalOnboardingStepSchema.safeParse(row?.step).data ?? "intro",
|
|
25
|
+
draft: PersonalOnboardingDraftSchema.parse(row ? JSON.parse(row.draft_json) : {}),
|
|
26
|
+
completed: row?.completed_at != null,
|
|
27
|
+
welcomeDone: row?.welcome_finished_at != null
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function savePersonalOnboarding(ownerId, step, draft) {
|
|
31
|
+
getSqliteDatabase().prepare(`INSERT INTO personal_agent_onboarding
|
|
32
|
+
(owner_id, step, draft_json, completed_at, updated_at) VALUES (?, ?, ?, NULL, ?)
|
|
33
|
+
ON CONFLICT(owner_id) DO UPDATE SET step = excluded.step, draft_json = excluded.draft_json,
|
|
34
|
+
updated_at = excluded.updated_at WHERE completed_at IS NULL`).run(ownerId, step, JSON.stringify(draft), Date.now());
|
|
35
|
+
}
|
|
36
|
+
function completePersonalOnboarding(ownerId) {
|
|
37
|
+
const now = Date.now();
|
|
38
|
+
getSqliteDatabase().prepare(`INSERT INTO personal_agent_onboarding
|
|
39
|
+
(owner_id, step, draft_json, completed_at, updated_at) VALUES (?, 'connections', '{}', ?, ?)
|
|
40
|
+
ON CONFLICT(owner_id) DO UPDATE SET completed_at = COALESCE(completed_at, excluded.completed_at),
|
|
41
|
+
updated_at = excluded.updated_at`).run(ownerId, now, now);
|
|
42
|
+
}
|
|
43
|
+
function finishPersonalWelcome(ownerId) {
|
|
44
|
+
getSqliteDatabase().prepare(`UPDATE personal_agent_onboarding
|
|
45
|
+
SET welcome_finished_at = COALESCE(welcome_finished_at, ?), updated_at = ? WHERE owner_id = ?`).run(Date.now(), Date.now(), ownerId);
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { PersonalOnboardingDraftSchema, PersonalOnboardingStepSchema, completePersonalOnboarding, finishPersonalWelcome, getPersonalOnboarding, savePersonalOnboarding };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type PersonalAgentState = 'provisioning' | 'ready' | 'error';
|
|
2
|
-
export type PersonalAppearance = '
|
|
2
|
+
export type PersonalAppearance = 'loopi' | 'loopi-curious' | 'loopi-care' | 'custom';
|
|
3
3
|
export interface PersonalAgentRecord {
|
|
4
4
|
ownerId: string;
|
|
5
5
|
agentId: string;
|
|
@@ -7,6 +7,11 @@ export interface PersonalAgentRecord {
|
|
|
7
7
|
state: PersonalAgentState;
|
|
8
8
|
displayName: string;
|
|
9
9
|
appearance: PersonalAppearance;
|
|
10
|
+
voicePreference: {
|
|
11
|
+
provider: string;
|
|
12
|
+
model: string;
|
|
13
|
+
voice: string;
|
|
14
|
+
} | null;
|
|
10
15
|
preferences: Record<string, unknown>;
|
|
11
16
|
revision: number;
|
|
12
17
|
errorMessage: string | null;
|
|
@@ -29,7 +29,11 @@ function personalSession(column, value) {
|
|
|
29
29
|
ORDER BY created_at LIMIT 1`).get(value) ?? null;
|
|
30
30
|
}
|
|
31
31
|
function appearanceFrom(agent) {
|
|
32
|
-
|
|
32
|
+
const avatar = agent.profile?.avatar;
|
|
33
|
+
if (avatar === "xopc:custom") return "custom";
|
|
34
|
+
if (avatar === "xopc:loopi:curious" || avatar === "xopc:loopi:listen" || !avatar && agent.profile?.emoji === "☁") return "loopi-curious";
|
|
35
|
+
if (avatar === "xopc:loopi:care" || !avatar && agent.profile?.emoji === "◕") return "loopi-care";
|
|
36
|
+
return "loopi";
|
|
33
37
|
}
|
|
34
38
|
function toRecord(ownerId, agent, session) {
|
|
35
39
|
const config = session ? getSessionConfig(session.conversation_id) : null;
|
|
@@ -39,8 +43,9 @@ function toRecord(ownerId, agent, session) {
|
|
|
39
43
|
agentId: agent.id,
|
|
40
44
|
conversationId: session?.conversation_id ?? personalConversationId(ownerId),
|
|
41
45
|
state: agent.provisioningState === "error" ? "error" : ready ? "ready" : "provisioning",
|
|
42
|
-
displayName: agent.profile?.name ?? "
|
|
46
|
+
displayName: agent.profile?.name ?? "Ada",
|
|
43
47
|
appearance: appearanceFrom(agent),
|
|
48
|
+
voicePreference: agent.profile?.voicePreference ?? null,
|
|
44
49
|
preferences: agent.profile?.responsePreferences ?? DEFAULT_PERSONAL_PREFERENCES,
|
|
45
50
|
revision: agent.revision,
|
|
46
51
|
errorMessage: agent.provisioningError ?? null
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { GatewayService } from '../gateway/service.js';
|
|
3
2
|
import { type PersonalAgentRecord } from './repository.js';
|
|
4
3
|
export declare const PersonalPreferencesSchema: z.ZodObject<{
|
|
5
4
|
addressAs: z.ZodOptional<z.ZodString>;
|
|
@@ -32,18 +31,42 @@ export declare const PersonalPreferencesSchema: z.ZodObject<{
|
|
|
32
31
|
}, z.core.$strict>;
|
|
33
32
|
export type PersonalPreferences = z.infer<typeof PersonalPreferencesSchema>;
|
|
34
33
|
export declare const PersonalAppearanceSchema: z.ZodEnum<{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
custom: "custom";
|
|
35
|
+
loopi: "loopi";
|
|
36
|
+
"loopi-curious": "loopi-curious";
|
|
37
|
+
"loopi-care": "loopi-care";
|
|
38
38
|
}>;
|
|
39
39
|
export type PersonalAppearance = z.infer<typeof PersonalAppearanceSchema>;
|
|
40
|
+
type PersonalAgentHost = {
|
|
41
|
+
refreshAgentCatalog(): void;
|
|
42
|
+
agentService: {
|
|
43
|
+
evictSessionAgent(conversationId: string): void;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
40
46
|
export declare function personalInstructions(preferences: PersonalPreferences): string;
|
|
41
|
-
export declare function refreshPersonalDelegationGuidance(service:
|
|
47
|
+
export declare function refreshPersonalDelegationGuidance(service: PersonalAgentHost, ownerId: string): Promise<void>;
|
|
42
48
|
export declare function listPersonalModels(): Promise<Array<{
|
|
43
49
|
id: string;
|
|
44
50
|
name: string;
|
|
45
51
|
}>>;
|
|
46
52
|
export declare function ensurePersonalConversationVisibility(ownerId: string): void;
|
|
47
|
-
export declare function createOrResumePersonalAgent(service:
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
export declare function createOrResumePersonalAgent(service: PersonalAgentHost, ownerId: string, requestedModel?: string, availableModels?: typeof listPersonalModels, initial?: {
|
|
54
|
+
displayName: string;
|
|
55
|
+
appearance: Exclude<PersonalAppearance, 'custom'>;
|
|
56
|
+
voicePreference?: {
|
|
57
|
+
provider: string;
|
|
58
|
+
model: string;
|
|
59
|
+
voice: string;
|
|
60
|
+
};
|
|
61
|
+
}): Promise<PersonalAgentRecord>;
|
|
62
|
+
export declare function patchPersonalProfile(service: PersonalAgentHost, ownerId: string, revision: number, displayName: string, preferences: PersonalPreferences, appearance: PersonalAppearance, voicePreference?: {
|
|
63
|
+
provider: string;
|
|
64
|
+
model: string;
|
|
65
|
+
voice: string;
|
|
66
|
+
} | null): Promise<PersonalAgentRecord | null>;
|
|
67
|
+
export declare function updatePersonalProfileRecord(ownerId: string, revision: number, displayName: string, preferences: PersonalPreferences, appearance: PersonalAppearance, voicePreference?: {
|
|
68
|
+
provider: string;
|
|
69
|
+
model: string;
|
|
70
|
+
voice: string;
|
|
71
|
+
} | null): Promise<PersonalAgentRecord | null>;
|
|
72
|
+
export {};
|
|
@@ -4,12 +4,13 @@ import { init_config_repository, setSessionConfig } from "../storage/sqlite/conf
|
|
|
4
4
|
import { ResponsePreferencesSchema } from "../agent-config/schema.js";
|
|
5
5
|
import { init_agent_config } from "../agent-config/index.js";
|
|
6
6
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
7
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
8
7
|
import { createConversation, init_conversation_repository } from "../storage/sqlite/conversation-repository.js";
|
|
9
8
|
import { getAvailableModels, init_providers } from "../providers/index.js";
|
|
10
9
|
import { getModelThinking } from "../providers/model-thinking.js";
|
|
10
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
11
11
|
import { DEFAULT_PERSONAL_PREFERENCES, getPersonalAgent, personalAgentId } from "./repository.js";
|
|
12
12
|
import { PERSONAL_MAIN_TOOL_IDS } from "./policy.js";
|
|
13
|
+
import { completePersonalOnboarding } from "./onboarding.js";
|
|
13
14
|
import { z } from "zod";
|
|
14
15
|
//#region src/personal-agent/service.ts
|
|
15
16
|
init_agent_config();
|
|
@@ -20,12 +21,16 @@ init_session_repository();
|
|
|
20
21
|
init_config_repository();
|
|
21
22
|
const PersonalPreferencesSchema = ResponsePreferencesSchema;
|
|
22
23
|
const PersonalAppearanceSchema = z.enum([
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"loopi",
|
|
25
|
+
"loopi-curious",
|
|
26
|
+
"loopi-care",
|
|
27
|
+
"custom"
|
|
26
28
|
]);
|
|
27
29
|
function appearanceEmoji(appearance) {
|
|
28
|
-
return appearance === "
|
|
30
|
+
return appearance === "loopi-curious" ? "◌" : appearance === "loopi-care" ? "♡" : "◉";
|
|
31
|
+
}
|
|
32
|
+
function appearanceAvatar(appearance) {
|
|
33
|
+
return appearance === "custom" ? "xopc:custom" : `xopc:loopi:${appearance === "loopi" ? "idle" : appearance.slice(6)}`;
|
|
29
34
|
}
|
|
30
35
|
const LEGACY_DELEGATION_RULE = "Answer simple requests directly. For complex work, use personal_task agents to find a suitable specialist, then create a Task and remain available to talk. Never claim a task was created before the tool confirms it.";
|
|
31
36
|
const PREVIOUS_DELEGATION_RULES = [
|
|
@@ -125,19 +130,20 @@ function ensurePersonalConversationVisibility(ownerId) {
|
|
|
125
130
|
}
|
|
126
131
|
});
|
|
127
132
|
}
|
|
128
|
-
function createOrResumePersonalAgent(service, ownerId, requestedModel, availableModels = listPersonalModels) {
|
|
133
|
+
function createOrResumePersonalAgent(service, ownerId, requestedModel, availableModels = listPersonalModels, initial) {
|
|
129
134
|
const current = inFlightProvisioning.get(ownerId);
|
|
130
135
|
if (current) return current;
|
|
131
|
-
const pending = provisionPersonalAgent(service, ownerId, requestedModel, availableModels);
|
|
136
|
+
const pending = provisionPersonalAgent(service, ownerId, requestedModel, availableModels, initial);
|
|
132
137
|
inFlightProvisioning.set(ownerId, pending);
|
|
133
138
|
pending.finally(() => {
|
|
134
139
|
if (inFlightProvisioning.get(ownerId) === pending) inFlightProvisioning.delete(ownerId);
|
|
135
140
|
}).catch(() => {});
|
|
136
141
|
return pending;
|
|
137
142
|
}
|
|
138
|
-
async function provisionPersonalAgent(service, ownerId, requestedModel, availableModels = listPersonalModels) {
|
|
143
|
+
async function provisionPersonalAgent(service, ownerId, requestedModel, availableModels = listPersonalModels, initial) {
|
|
139
144
|
const existingIdentity = getPersonalAgent(ownerId);
|
|
140
145
|
if (existingIdentity?.state === "ready") {
|
|
146
|
+
completePersonalOnboarding(ownerId);
|
|
141
147
|
await refreshPersonalDelegationGuidance(service, ownerId);
|
|
142
148
|
ensurePersonalConversationVisibility(ownerId);
|
|
143
149
|
return getPersonalAgent(ownerId) ?? existingIdentity;
|
|
@@ -154,11 +160,13 @@ async function provisionPersonalAgent(service, ownerId, requestedModel, availabl
|
|
|
154
160
|
id: agentId,
|
|
155
161
|
enabled: true,
|
|
156
162
|
profile: {
|
|
157
|
-
name:
|
|
163
|
+
name: initial?.displayName ?? "Ada",
|
|
158
164
|
description: "A personal AI that adapts its responses to the user and coordinates work.",
|
|
159
165
|
creature: "assistant",
|
|
160
166
|
language: "zh",
|
|
161
|
-
emoji: appearanceEmoji("
|
|
167
|
+
emoji: appearanceEmoji(initial?.appearance ?? "loopi"),
|
|
168
|
+
avatar: appearanceAvatar(initial?.appearance ?? "loopi"),
|
|
169
|
+
...initial?.voicePreference ? { voicePreference: initial.voicePreference } : {},
|
|
162
170
|
responsePreferences: DEFAULT_PERSONAL_PREFERENCES,
|
|
163
171
|
instructions: personalInstructions(DEFAULT_PERSONAL_PREFERENCES)
|
|
164
172
|
},
|
|
@@ -203,22 +211,25 @@ async function provisionPersonalAgent(service, ownerId, requestedModel, availabl
|
|
|
203
211
|
fixedModel: true,
|
|
204
212
|
thinkingLevel: "off"
|
|
205
213
|
}, process.cwd());
|
|
214
|
+
completePersonalOnboarding(ownerId);
|
|
206
215
|
return getPersonalAgent(ownerId) ?? record;
|
|
207
216
|
}
|
|
208
|
-
async function patchPersonalProfile(service, ownerId, revision, displayName, preferences, appearance) {
|
|
209
|
-
const updated = await updatePersonalProfileRecord(ownerId, revision, displayName, preferences, appearance);
|
|
217
|
+
async function patchPersonalProfile(service, ownerId, revision, displayName, preferences, appearance, voicePreference) {
|
|
218
|
+
const updated = await updatePersonalProfileRecord(ownerId, revision, displayName, preferences, appearance, voicePreference);
|
|
210
219
|
if (!updated) return null;
|
|
211
220
|
service.refreshAgentCatalog();
|
|
212
221
|
service.agentService.evictSessionAgent(updated.conversationId);
|
|
213
222
|
return updated;
|
|
214
223
|
}
|
|
215
|
-
async function updatePersonalProfileRecord(ownerId, revision, displayName, preferences, appearance) {
|
|
224
|
+
async function updatePersonalProfileRecord(ownerId, revision, displayName, preferences, appearance, voicePreference) {
|
|
216
225
|
const current = new AgentCatalogRepository().get(personalAgentId(ownerId));
|
|
217
226
|
if (!current || current.provisioningState !== "ready" || current.revision !== revision || getPersonalAgent(ownerId)?.state !== "ready") return null;
|
|
218
227
|
const profile = {
|
|
219
228
|
...current.profile,
|
|
220
229
|
name: displayName,
|
|
221
230
|
emoji: appearanceEmoji(appearance),
|
|
231
|
+
avatar: appearanceAvatar(appearance),
|
|
232
|
+
...voicePreference !== void 0 ? { voicePreference: voicePreference ?? void 0 } : {},
|
|
222
233
|
responsePreferences: preferences,
|
|
223
234
|
instructions: personalInstructions(preferences)
|
|
224
235
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { init_paths_state, resolveXopcCloudCatalogCachePath } from "../config/paths-state.js";
|
|
3
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
3
|
import { ComputerProfileSchema, init_src } from "../../packages/computer-control-contract/src/index.js";
|
|
4
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
5
5
|
import { voiceManifestSchema } from "../../packages/realtime-protocol/src/voice-catalog.js";
|
|
6
6
|
import { init_voice } from "../../packages/realtime-protocol/src/voice.js";
|
|
7
7
|
import { readFileSync, rmSync } from "node:fs";
|
|
@@ -138,7 +138,7 @@ var init_model_catalog_persistence = __esmMin((() => {
|
|
|
138
138
|
baseUrl: z.string().url(),
|
|
139
139
|
api: z.enum(["openai-completions", "openai-responses"]),
|
|
140
140
|
recommendedModel: z.string().nullable(),
|
|
141
|
-
recommended: z.
|
|
141
|
+
recommended: z.partialRecord(z.enum([
|
|
142
142
|
"vision",
|
|
143
143
|
"image-generation",
|
|
144
144
|
"stt",
|
|
@@ -3,7 +3,7 @@ import type { ApplyMigrationsOptions } from './types.js';
|
|
|
3
3
|
/** Baseline schema version applied from schema.sql on first open. */
|
|
4
4
|
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 165;
|
|
5
5
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
6
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
6
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 230;
|
|
7
7
|
export declare function resolveMigrationsDir(override?: string): string;
|
|
8
8
|
/**
|
|
9
9
|
* Apply sequential SQL migrations from (currentVersion + 1) through targetVersion.
|
|
@@ -57,7 +57,7 @@ function applySingleMigration(db, migration, discardOldScenes = false) {
|
|
|
57
57
|
*/
|
|
58
58
|
function applyPendingMigrations(db, options = {}) {
|
|
59
59
|
db.function("xopc_operation_id", () => currentOperationId() ?? null);
|
|
60
|
-
const targetVersion = options.targetVersion ??
|
|
60
|
+
const targetVersion = options.targetVersion ?? 230;
|
|
61
61
|
let currentVersion = readSchemaVersion(db);
|
|
62
62
|
if (currentVersion > targetVersion) throw new DatabaseSchemaTooNewError(currentVersion, targetVersion);
|
|
63
63
|
if (!options.migrationsDir && currentVersion < 165) throw new DatabaseSchemaTooOldError(currentVersion, 165);
|
|
@@ -95,7 +95,7 @@ function applyPendingMigrations(db, options = {}) {
|
|
|
95
95
|
}
|
|
96
96
|
/** Inspect schema version without mutating the database. */
|
|
97
97
|
function inspectSchemaMigrationStatus(db, options = {}) {
|
|
98
|
-
const appVersion = options.targetVersion ??
|
|
98
|
+
const appVersion = options.targetVersion ?? 230;
|
|
99
99
|
const dbVersion = readSchemaVersion(db);
|
|
100
100
|
if (dbVersion > appVersion) return {
|
|
101
101
|
dbVersion,
|
|
@@ -137,7 +137,7 @@ var init_runner = __esmMin((() => {
|
|
|
137
137
|
init_errors();
|
|
138
138
|
log = createLogger("Sqlite:Migrations");
|
|
139
139
|
XOPC_DB_BASELINE_SCHEMA_VERSION = 165;
|
|
140
|
-
XOPC_DB_SCHEMA_VERSION =
|
|
140
|
+
XOPC_DB_SCHEMA_VERSION = 230;
|
|
141
141
|
}));
|
|
142
142
|
//#endregion
|
|
143
143
|
init_runner();
|
|
@@ -2,10 +2,10 @@ import { ProductReadContracts } from "../../../packages/gateway-contract/src/cap
|
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
3
|
import { TaskRepository, init_task_repository } from "../task-repository.js";
|
|
4
4
|
import { TaskRunRepository, init_task_run_repository } from "../task-run-repository.js";
|
|
5
|
-
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
6
|
-
import { defineReadCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
7
5
|
import { TaskConversationRepository } from "../task-conversation-repository.js";
|
|
8
6
|
import { TaskReadModelProjector } from "../task-read-model-projector.js";
|
|
7
|
+
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
8
|
+
import { defineReadCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
9
9
|
import { TaskContextRepository } from "../task-context-repository.js";
|
|
10
10
|
import { TaskDependencyService } from "../task-dependency-service.js";
|
|
11
11
|
import { TaskCriterionReviewRepository } from "../task-criterion-review-repository.js";
|
|
@@ -9,9 +9,8 @@ import { appendComposerInputHistory, listComposerInputHistory } from "../../stor
|
|
|
9
9
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
10
10
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
11
11
|
import { normalizeAgentId } from "../../agent-catalog/id.js";
|
|
12
|
-
import { init_agent_scope, listAgentEntries } from "../../agent/agent-scope.js";
|
|
13
|
-
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
14
12
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
13
|
+
import { init_agent_scope, listAgentEntries } from "../../agent/agent-scope.js";
|
|
15
14
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../../routing/agent-session-key.js";
|
|
16
15
|
import { resolveEffectiveAgentProfile } from "../../config/agent-profile.js";
|
|
17
16
|
import { init_paths } from "../../config/paths.js";
|
|
@@ -23,6 +22,7 @@ import { buildSessionTimeline } from "../../session/transcript-outline.js";
|
|
|
23
22
|
import { transcriptRowsToClientHistory } from "../../session/client-history.js";
|
|
24
23
|
import { createCreateShareTool, isShareToolAvailable } from "../../agent/tools/create-share-tool.js";
|
|
25
24
|
import { evictEmbeddedSessionRunner } from "../../agent/embedded/session-runner.js";
|
|
25
|
+
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
26
26
|
import { SessionIndex } from "../../session/manager.js";
|
|
27
27
|
import "../../session/index.js";
|
|
28
28
|
import { parseModelRef } from "../../agent/models/selection.js";
|
|
@@ -47,7 +47,7 @@ function initializeVoiceDefaults(config, language = inferProductLanguageFromEnvi
|
|
|
47
47
|
providers: {
|
|
48
48
|
...audio?.providers ?? {},
|
|
49
49
|
alibaba: {
|
|
50
|
-
model: "qwen-audio-3.
|
|
50
|
+
model: "qwen-audio-3.1-asr-flash",
|
|
51
51
|
...audio?.providers?.alibaba ?? {}
|
|
52
52
|
},
|
|
53
53
|
openai: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OPENAI_TTS_MODELS, OPENAI_TTS_VOICES } from "../tts/providers/openai-speech.js";
|
|
2
|
+
import { alibabaTtsVoices as alibabaTtsVoices$1 } from "../tts/providers/alibaba-voices.js";
|
|
2
3
|
import { MINIMAX_TTS_MODELS, MINIMAX_TTS_VOICES } from "../tts/providers/minimax-speech.js";
|
|
3
4
|
import "../tts/providers/index.js";
|
|
4
5
|
import { registerVoiceProviderMetadata } from "./registry.js";
|
|
@@ -13,13 +14,16 @@ function options(values, names) {
|
|
|
13
14
|
}));
|
|
14
15
|
}
|
|
15
16
|
const alibabaSttModels = [{
|
|
17
|
+
id: "qwen-audio-3.1-asr-flash",
|
|
18
|
+
name: "Qwen Audio 3.1 ASR Flash"
|
|
19
|
+
}, {
|
|
16
20
|
id: "qwen-audio-3.0-asr-flash",
|
|
17
21
|
name: "Qwen Audio 3.0 ASR Flash"
|
|
18
22
|
}];
|
|
19
23
|
const alibabaTtsModels = [
|
|
20
24
|
{
|
|
21
25
|
id: "qwen-tts",
|
|
22
|
-
name: "Qwen TTS (
|
|
26
|
+
name: "Qwen TTS (Legacy)"
|
|
23
27
|
},
|
|
24
28
|
{
|
|
25
29
|
id: "qwen-tts-realtime",
|
|
@@ -27,47 +31,20 @@ const alibabaTtsModels = [
|
|
|
27
31
|
},
|
|
28
32
|
{
|
|
29
33
|
id: "qwen3-tts-flash",
|
|
30
|
-
name: "Qwen3 TTS Flash"
|
|
34
|
+
name: "Qwen3 TTS Flash (Recommended)"
|
|
31
35
|
},
|
|
32
36
|
{
|
|
33
37
|
id: "qwen3-tts-instruct-flash",
|
|
34
38
|
name: "Qwen3 TTS Instruct Flash"
|
|
35
39
|
}
|
|
36
40
|
];
|
|
37
|
-
const alibabaTtsVoices =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
name: "Ethan"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
id: "Serena",
|
|
48
|
-
name: "Serena"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
id: "Chelsie",
|
|
52
|
-
name: "Chelsie"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
id: "longxiaochun",
|
|
56
|
-
name: "Long Xiao Chun (龙小春)"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: "longxiaobai",
|
|
60
|
-
name: "Long Xiao Bai (龙小白)"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: "longwan",
|
|
64
|
-
name: "Long Wan (龙婉)"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
id: "longcheng",
|
|
68
|
-
name: "Long Cheng (龙呈)"
|
|
69
|
-
}
|
|
70
|
-
];
|
|
41
|
+
const alibabaTtsVoices = alibabaTtsVoices$1.map(({ id, name, description, gender, category }) => ({
|
|
42
|
+
id,
|
|
43
|
+
name: name ?? id,
|
|
44
|
+
description,
|
|
45
|
+
gender,
|
|
46
|
+
style: category
|
|
47
|
+
}));
|
|
71
48
|
const edgeVoices = [
|
|
72
49
|
{
|
|
73
50
|
id: "en-US-MichelleNeural",
|
|
@@ -161,7 +138,7 @@ const builtinVoiceProviderMetadata = [
|
|
|
161
138
|
label: "Model",
|
|
162
139
|
type: "select",
|
|
163
140
|
options: alibabaSttModels,
|
|
164
|
-
defaultValue: "qwen-audio-3.
|
|
141
|
+
defaultValue: "qwen-audio-3.1-asr-flash"
|
|
165
142
|
},
|
|
166
143
|
{
|
|
167
144
|
key: "language",
|
|
@@ -356,14 +333,14 @@ const builtinVoiceProviderMetadata = [
|
|
|
356
333
|
label: "Model",
|
|
357
334
|
type: "select",
|
|
358
335
|
options: alibabaTtsModels,
|
|
359
|
-
defaultValue: "
|
|
336
|
+
defaultValue: "qwen3-tts-flash"
|
|
360
337
|
},
|
|
361
338
|
{
|
|
362
339
|
key: "voice",
|
|
363
340
|
label: "Voice",
|
|
364
341
|
type: "select",
|
|
365
342
|
options: alibabaTtsVoices,
|
|
366
|
-
defaultValue: "
|
|
343
|
+
defaultValue: "Cherry"
|
|
367
344
|
}
|
|
368
345
|
],
|
|
369
346
|
diagnostics: {
|
|
@@ -24,6 +24,9 @@ export declare function requirePlatformVoiceModel(id: string, mode: VoiceModeCap
|
|
|
24
24
|
id: string;
|
|
25
25
|
name: string;
|
|
26
26
|
languages: string[];
|
|
27
|
+
gender?: "female" | "male";
|
|
28
|
+
style?: string;
|
|
29
|
+
description?: string;
|
|
27
30
|
}[];
|
|
28
31
|
limits: {
|
|
29
32
|
maxFrameBytes: number;
|
|
@@ -59,12 +59,16 @@ function createAgentVoiceEngine(options) {
|
|
|
59
59
|
});
|
|
60
60
|
send("turn.committed", { turnId });
|
|
61
61
|
if (queuedTurns >= 8) {
|
|
62
|
+
log.warn({
|
|
63
|
+
sessionId: claim.sessionId,
|
|
64
|
+
queuedTurns,
|
|
65
|
+
turnId
|
|
66
|
+
}, "Realtime voice turn dropped because the input queue is full");
|
|
62
67
|
send("session.error", {
|
|
63
68
|
code: "INPUT_BACKPRESSURE",
|
|
64
|
-
message: "Too many queued voice turns",
|
|
65
|
-
recoverable:
|
|
69
|
+
message: "Too many queued voice turns; please repeat the last request",
|
|
70
|
+
recoverable: true
|
|
66
71
|
});
|
|
67
|
-
options.onClose("input_backpressure", true);
|
|
68
72
|
return;
|
|
69
73
|
}
|
|
70
74
|
queuedTurns += 1;
|
|
@@ -247,6 +251,7 @@ function createAgentVoiceEngine(options) {
|
|
|
247
251
|
startedAt: Date.now(),
|
|
248
252
|
firstTextSeen: false,
|
|
249
253
|
awaitingClarification: false,
|
|
254
|
+
taskDone: false,
|
|
250
255
|
pcm: new PcmFrameBuffer()
|
|
251
256
|
};
|
|
252
257
|
const taskUpdateExposed = () => Boolean(updateClientMessageId && response.text.trim());
|
|
@@ -304,10 +309,13 @@ function createAgentVoiceEngine(options) {
|
|
|
304
309
|
});
|
|
305
310
|
if (event.type === "run_end" || event.type === "stream_end") {
|
|
306
311
|
const status = event.payload?.status;
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
312
|
+
if (!response.taskDone) {
|
|
313
|
+
response.taskDone = true;
|
|
314
|
+
send("task.done", {
|
|
315
|
+
taskId: task.taskId,
|
|
316
|
+
status: status === "cancelled" ? "cancelled" : status === "suspended" ? "suspended" : status === "error" ? "failed" : "completed"
|
|
317
|
+
});
|
|
318
|
+
}
|
|
311
319
|
}
|
|
312
320
|
if (event.type === "clarify_request" && typeof event.payload?.requestId === "string" && typeof event.payload?.question === "string") {
|
|
313
321
|
response.awaitingClarification = true;
|
|
@@ -364,6 +372,13 @@ function createAgentVoiceEngine(options) {
|
|
|
364
372
|
message: "Voice response failed",
|
|
365
373
|
recoverable: true
|
|
366
374
|
});
|
|
375
|
+
if (response.taskId && !response.taskDone) {
|
|
376
|
+
response.taskDone = true;
|
|
377
|
+
send("task.done", {
|
|
378
|
+
taskId: response.taskId,
|
|
379
|
+
status: "failed"
|
|
380
|
+
});
|
|
381
|
+
}
|
|
367
382
|
if (response.audioStarted) send("response.audio.done", { responseId: response.id });
|
|
368
383
|
send("response.done", {
|
|
369
384
|
responseId: response.id,
|
|
@@ -405,13 +420,17 @@ function createAgentVoiceEngine(options) {
|
|
|
405
420
|
function bufferFinal(utteranceId, text) {
|
|
406
421
|
try {
|
|
407
422
|
turn.final(utteranceId, text);
|
|
408
|
-
} catch {
|
|
423
|
+
} catch (error) {
|
|
424
|
+
log.warn({
|
|
425
|
+
err: error,
|
|
426
|
+
sessionId: claim.sessionId,
|
|
427
|
+
utteranceId
|
|
428
|
+
}, "Realtime voice turn exceeded the input limit");
|
|
409
429
|
send("session.error", {
|
|
410
430
|
code: "INPUT_BACKPRESSURE",
|
|
411
|
-
message: "Voice turn input limit reached",
|
|
412
|
-
recoverable:
|
|
431
|
+
message: "Voice turn input limit reached; please repeat the request",
|
|
432
|
+
recoverable: true
|
|
413
433
|
});
|
|
414
|
-
options.onClose("input_backpressure", true);
|
|
415
434
|
}
|
|
416
435
|
}
|
|
417
436
|
function onSttEvent(event) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_agent_scope, resolveAgentProfileDir } from "../../agent/agent-scope.js";
|
|
2
|
-
import { DEFAULT_SOUL_FILENAME } from "../../agent/context/workspace.js";
|
|
3
2
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
3
|
+
import { DEFAULT_SOUL_FILENAME } from "../../agent/context/workspace.js";
|
|
4
4
|
import { loadProfileBootstrapFiles } from "../../agent/bootstrap/load-bootstrap-files.js";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { statSync } from "node:fs";
|
|
@@ -7,6 +7,7 @@ import { getModelCatalogStore, init_model_catalog_store } from "../../providers/
|
|
|
7
7
|
import { getMediaUnderstandingProvider } from "../../media-understanding/registry.js";
|
|
8
8
|
import { resolveSTTProviderChain } from "../stt/factory.js";
|
|
9
9
|
import { mergeSttConfigFromAppConfig } from "../stt/config.js";
|
|
10
|
+
import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
|
|
10
11
|
import { ALIBABA_REALTIME_TTS_MODEL } from "../tts/providers/alibaba-speech.js";
|
|
11
12
|
import { resolveSpeechProviderChain } from "../tts/factory.js";
|
|
12
13
|
import { mergeTtsConfigFromAppConfig } from "../tts/merge-config.js";
|
|
@@ -186,7 +187,21 @@ var VoiceRealtimeRuntime = class {
|
|
|
186
187
|
if (!omni && !stt) throw new VoiceSessionCreationError("PROVIDER_UNAVAILABLE", "No configured streaming speech-to-text provider is available", 503);
|
|
187
188
|
const inputMode = "server_vad";
|
|
188
189
|
if (stt && !stt.plugin.streamingAudio.turnDetection.includes(inputMode)) throw new VoiceSessionCreationError("PROVIDER_UNAVAILABLE", `Streaming speech-to-text provider does not support ${inputMode}`, 503);
|
|
189
|
-
const
|
|
190
|
+
const baseTts = request.mode === "assistant" ? resolveStreamingTts(config) : void 0;
|
|
191
|
+
const personalVoice = request.conversationId ? getPersonalAgentByConversation(request.conversationId)?.voicePreference : null;
|
|
192
|
+
const tts = baseTts && personalVoice && baseTts.route.provider === personalVoice.provider && baseTts.route.model === personalVoice.model ? {
|
|
193
|
+
...baseTts,
|
|
194
|
+
config: {
|
|
195
|
+
...baseTts.config,
|
|
196
|
+
providers: {
|
|
197
|
+
...baseTts.config.providers,
|
|
198
|
+
[baseTts.route.provider]: {
|
|
199
|
+
...baseTts.config.providers?.[baseTts.route.provider],
|
|
200
|
+
voice: personalVoice.voice
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
} : baseTts;
|
|
190
205
|
if (request.purpose === "conversation") {
|
|
191
206
|
if (!request.conversationId || !await this.options.sessionExists(request.conversationId)) throw new VoiceSessionCreationError("SESSION_NOT_FOUND", "Conversation session was not found", 404);
|
|
192
207
|
if (request.mode === "natural" && this.options.sessionBusy(request.conversationId)) throw new VoiceSessionCreationError("SESSION_CONFLICT", "Conversation session already has an active response", 409);
|