@xopcai/xopc 0.0.354 → 0.0.355
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/{agent-avatar-dicebear-B8PS1eLP.js → agent-avatar-dicebear-DiEBNuSv.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-CLBSL9hl.js → agent-defaults-settings-panel-DpBmB3QX.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-BninweSg.js → agent-plugin-dialog-DlojWUY_.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-CcVLP_WP.js → agents-CeSCdUHP.js} +3 -3
- package/dist/gateway/static/root/assets/{app-management-settings-panel-COdQOmdT.js → app-management-settings-panel-MkSa6isi.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CDNjc2yy.js → appearance-settings-B7hCkaT_.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-C-kvpPj8.js → apps-page-D_CduJuC.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-87DN5nXX.js → automations-page-uEnQawd7.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-BdZ8NO8k.js → automations-workspace-pdiSK3Qk.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-B04Kv5DU.js → block-editor-r4mKGacz.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-Ck6Zb9aU.js → browser-automations-page-Blrxyy_h.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-DHlyYItE.js → browser-settings-page-DGuwrO7j.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-C-6RLFNh.js → capabilities-page-DUIA2K--.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-CST_HBkR.js → capabilities-settings-panel-CwPNQsJS.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-PBPJJsp6.js → capability-header-actions-CyvI2F5x.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-CM4sIvcP.js → channels-DBxDJV8I.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DTd7mWyE.js → chat-terminal-dock-YdxhecE7.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page--9rh1mvu.js → computer-settings-page-BuCrA8yD.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-v6Is0BOO.js → connector-service-page-BiB2GYkp.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-CryQzmEZ.js → connectors-page-nQAgZk-5.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-DTsMzjoZ.js → date-picker-BJtADyRQ.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-Y1QYCcLp.js → dependency-picker-D-Ko0G40.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-D9dfZrOp.js → desktop-pet-CVPWcWwC.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BHVOHZUL.js → desktop-pet-settings-BcN_I-7y.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-Cy5YDZ2b.js → device-pairing-wizard-CoKKoUlt.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DeMo9KlE.js → directory-picker-path-field-m0CubGEP.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-AWrvy1Nb.js → extension-page-Dd88ynHj.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-C5KgmhYu.js → extension-settings-page-Dq1MXh6D.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DC-lok0J.js → gateway-settings-C_bTRQeE.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-C29_VFAs.js → home-page-xbqSikkK.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BKVKfVMA.js → imports-page-Cd4tcbLU.js} +1 -1
- package/dist/gateway/static/root/assets/{index-BJh5gU04.css → index-BuzC93X-.css} +1 -1
- package/dist/gateway/static/root/assets/{index-ByFXhQ-T.js → index-CYeGnj-L.js} +43 -44
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DiwE4gKU.js → keyboard-shortcuts-settings-CmalfzgQ.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-Dt3TC64L.js → local-app-workbench-page-BquHHLj6.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DFPhWkxU.js → local-apps-page-RPLHMvYs.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-C4faHZHj.js → logs-page-7NMGltSw.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-pZLdvIiw.js → management-settings-zwFewbhp.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-BLnT1tYJ.js → note-detail-panel-CwMg9cvF.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-page-BawArJvP.js → notes-page-CWJwrvo7.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CiBUm2Br.js → page-context-capture-button-DqmAq4Ov.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-Bbgx_dgV.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-B8_w6c3J.js → product-open-page-SsG2sljT.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-CDZdKiTz.js → project-detail-page-wp5cFhM7.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BvahSrZi.js → projects-page-Brfi519S.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-CU_UdkuI.js → remote-access-hub-BdtF8Cvk.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BnMS50vK.js → runtime-tools-settings-panel-CT6HKczq.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-CDR1-q25.js → scenes-page-BmlI42OR.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-B4Xa8w8S.js → schema-form-DEcsbgne.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-Ymyg98G-.js → sessions-page-C_G8fZwV.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CDxdzwDs.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-CHZdpvkT.js → settings-page-P50kLPUz.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-HESfALIF.js → setup-status-panel-DtnwH0wN.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-CXEBo5YL.js → shares-settings-7Ak_MsJg.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-DYgcO7y0.js → skill-api-CcdHQhxd.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-Dx5v64jU.js → skills-page-ChjXDxdX.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-wXCBwYwE.js → system-settings-panel-DAR0w3Xi.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-hoIyr7tp.js → task-detail-page-DEx0kXDV.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-C0t8y3Mi.js → tunnel-api-CBy97LfF.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-A2DZAidl.js → usage-page-BdX6VPQC.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-C1jGTwjK.js → user-model-page-CRxiQnWG.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-xB0QpOFk.js → work-discovery-overlay-DvwmD9Ma.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-rM4U1FXc.js → workflow-run-setup-panel-BQ3fmhM-.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-QKC34FzQ.js → workflows-page-Bl8rd4fM.js} +1 -1
- package/dist/gateway/static/root/index.html +2 -2
- package/dist/package.js +1 -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/embedded/run-for-session.d.ts +1 -0
- package/dist/src/agent/embedded/run-for-session.js +2 -1
- package/dist/src/agent/embedded/run-turn.js +19 -1
- package/dist/src/agent/embedded/types.d.ts +1 -0
- 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/prompt/sections/messaging-runtime.js +2 -1
- package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -0
- package/dist/src/agent/service/direct-turn-helpers.js +1 -0
- package/dist/src/agent/service/process-direct-streaming.js +1 -0
- 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/personal-preference-tool.d.ts +1 -1
- package/dist/src/agent/tools/personal-preference-tool.js +3 -2
- package/dist/src/agent/tools/personal-task-tool.d.ts +2 -1
- package/dist/src/agent/tools/personal-task-tool.js +26 -7
- 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 +5 -1
- package/dist/src/agent-config/schema.js +2 -1
- 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/models.js +3 -3
- 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/notes.js +2 -2
- package/dist/src/gateway/hono/routes/personal-agent.js +16 -1
- 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/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +41 -0
- package/dist/src/gateway/service/run-gateway-agent.js +2 -1
- package/dist/src/gateway/service.js +13 -13
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +9 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.js +43 -3
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/personal-agent/service.d.ts +1 -0
- package/dist/src/personal-agent/service.js +14 -2
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/task-main-update-delivery.js +5 -2
- package/dist/src/tasks/task-origin-repository.d.ts +4 -1
- package/dist/src/tasks/task-origin-repository.js +3 -3
- package/dist/src/tasks/task-run-coordinator.d.ts +1 -0
- package/dist/src/tasks/task-run-coordinator.js +13 -7
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -1
- package/dist/src/tasks/task-run-dispatcher.js +6 -4
- package/dist/src/tui/backends/embedded-backend.js +2 -2
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/personal-page-Cng583RH.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-wMZhxwTM.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_agent_scope, resolveAgentProfileDir } from "../../agent/agent-scope.js";
|
|
2
|
-
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
3
2
|
import { DEFAULT_SOUL_FILENAME } from "../../agent/context/workspace.js";
|
|
3
|
+
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.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";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.355",
|
|
4
4
|
"description": "Local-first personal AI for the one-person company, with durable context, tasks, workflows, automations, and local or cloud models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -159,11 +159,11 @@
|
|
|
159
159
|
"vitest": "4.1.5",
|
|
160
160
|
"vue": "^3.5.35",
|
|
161
161
|
"@xopcai/browser-control-contract": "0.1.0",
|
|
162
|
+
"@xopcai/gateway-contract": "0.0.0",
|
|
163
|
+
"@xopcai/realtime-client": "0.0.0",
|
|
162
164
|
"@xopcai/endpoint-tools-client": "0.0.0",
|
|
163
165
|
"@xopcai/endpoint-tools-protocol": "0.0.0",
|
|
164
166
|
"@xopcai/computer-control-contract": "0.1.0",
|
|
165
|
-
"@xopcai/realtime-client": "0.0.0",
|
|
166
|
-
"@xopcai/gateway-contract": "0.0.0",
|
|
167
167
|
"@xopcai/realtime-protocol": "0.0.0"
|
|
168
168
|
},
|
|
169
169
|
"scripts": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-aKtaBQYM.js";import{a as t,n,t as r}from"./vendor-react-BOUWij0V.js";import{t as i}from"./chunk-KS7C4IRE-BMYIfy9x.js";import{t as a}from"./popover-select-DcsFzD_i.js";import{b as o}from"./markdown-view-7tzqIp_G.js";import{t as s}from"./settings-2-D-csvaET.js";import{t as c}from"./x-B_N4OPjy.js";import{a as l,n as u,r as d}from"./locale-store-Y1aBayM_.js";import{t as f}from"./skeleton-BwbyijEw.js";import{Dr as p,Ki as m,Ko as h,Mc as g,Wi as _,jc as v,n as y,os as b,ps as x,ra as S}from"./index-ByFXhQ-T.js";var C=n(),w=e(t(),1),T=r();function ee(e){let t=e.replace(/\s+/g,` `).trim();if(t.length<=58)return t;let n=t.replace(/([^)]{1,80})|\([^)]{1,80}\)/g,``).replace(/([A-Za-z0-9])(?=[\u4e00-\u9fff])/g,`$1 `).replace(/\s+/g,` `).trim(),r=n.split(/[。!?;;,]/,1)[0]?.trim()||n;return r.length>58?`${r.slice(0,57).trimEnd()}…`:r}function te(e,t){return e.phase===`closed`?{label:t?`已结束`:`Finished`,tone:`bg-fg-subtle`}:e.runStatus===`running`?{label:t?`正在执行`:`Working`,tone:`bg-accent`}:e.runStatus===`queued`?{label:t?`等待开始`:`Queued`,tone:`bg-fg-subtle`}:e.runStatus===`failed`?{label:t?`需要关注`:`Needs attention`,tone:`bg-danger`}:e.runStatus===`waiting`?{label:t?`等待继续`:`Waiting`,tone:`bg-warning`}:e.runStatus===`verifying`||e.runStatus===`succeeded`||e.phase===`review`?{label:t?`等待验收`:`In review`,tone:`bg-warning`}:e.runStatus===`cancelled`?{label:t?`已暂停`:`Stopped`,tone:`bg-fg-subtle`}:e.phase===`active`?{label:t?`正在推进`:`In progress`,tone:`bg-accent`}:e.phase===`ready`?{label:t?`准备开始`:`Ready`,tone:`bg-fg-subtle`}:{label:t?`待处理`:`Planned`,tone:`bg-fg-subtle`}}function ne(e){let t=(0,C.c)(30),{item:n,zh:r}=e,a;t[0]!==n||t[1]!==r?(a=te(n,r),t[0]=n,t[1]=r,t[2]=a):a=t[2];let s=a,c;t[3]===n.id?c=t[4]:(c=o(`/personal`,n.id),t[3]=n.id,t[4]=c);let l=`mt-2 size-1.5 shrink-0 rounded-full ${s.tone}`,u;t[5]===l?u=t[6]:(u=(0,T.jsx)(`span`,{className:l,"aria-hidden":!0}),t[5]=l,t[6]=u);let d;t[7]===n.title?d=t[8]:(d=ee(n.title),t[7]=n.title,t[8]=d);let f;t[9]===d?f=t[10]:(f=(0,T.jsx)(`span`,{className:`line-clamp-2 break-words text-sm font-medium leading-5 text-fg`,children:d}),t[9]=d,t[10]=f);let m;t[11]===s.label?m=t[12]:(m=(0,T.jsx)(`span`,{children:s.label}),t[11]=s.label,t[12]=m);let h;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,T.jsx)(`span`,{className:`text-fg-subtle`,"aria-hidden":!0,children:`·`}),t[13]=h):h=t[13];let g=r?`zh`:`en`,_;t[14]!==n.updatedAt||t[15]!==g?(_=p(n.updatedAt,g),t[14]=n.updatedAt,t[15]=g,t[16]=_):_=t[16];let y;t[17]===_?y=t[18]:(y=(0,T.jsx)(`span`,{children:_}),t[17]=_,t[18]=y);let b;t[19]!==y||t[20]!==m?(b=(0,T.jsxs)(`span`,{className:`mt-1.5 flex items-center gap-2 text-xs text-fg-muted`,children:[m,h,y]}),t[19]=y,t[20]=m,t[21]=b):b=t[21];let x;t[22]!==b||t[23]!==f?(x=(0,T.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[f,b]}),t[22]=b,t[23]=f,t[24]=x):x=t[24];let S;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,T.jsx)(v,{className:`mt-0.5 size-4 shrink-0 text-fg-subtle opacity-0 transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100`,"aria-hidden":!0}),t[25]=S):S=t[25];let w;return t[26]!==x||t[27]!==c||t[28]!==u?(w=(0,T.jsxs)(i,{to:c,className:`group flex min-w-0 items-start gap-3 rounded-xl px-3 py-3.5 transition-colors duration-150 hover:bg-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[u,x,S]}),t[26]=x,t[27]=c,t[28]=u,t[29]=w):w=t[29],w}var E=[{id:`direct`,warmth:`reserved`,zh:`直接清楚`,en:`Clear and direct`,zhExample:`先说结论,再说明下一步。`,enExample:`Lead with the answer, then the next step.`},{id:`natural`,warmth:`balanced`,zh:`自然有分寸`,en:`Natural and measured`,zhExample:`说清重点,也留出必要的解释。`,enExample:`Cover the point, with enough context to act.`},{id:`gentle`,warmth:`gentle`,zh:`温和耐心`,en:`Warm and patient`,zhExample:`语气柔和一些,仍然把事情说清楚。`,enExample:`Be gentle while keeping the answer clear.`}],D=[{id:`spark`,zh:`星形`,en:`Star`,color:`bg-amber-100/40 dark:bg-amber-400/10`},{id:`cloud`,zh:`云形`,en:`Cloud`,color:`bg-sky-100/40 dark:bg-sky-400/10`},{id:`bean`,zh:`圆形`,en:`Round`,color:`bg-lime-100/40 dark:bg-lime-400/10`}];function O(e){return D.find(t=>t.id===e)??D[0]}function re(e,t){return e.warmth===`reserved`?t?`你可以直接说目标或问题。我会先给结论,需要时再展开。`:`Tell me the goal or question. I’ll lead with the answer and expand when useful.`:e.warmth===`gentle`?t?`想聊一件事,或让我帮你推进工作,都可以从这里开始。我会认真听,也会把下一步说清楚。`:`You can talk something through or ask me to move work forward. I’ll listen carefully and make the next step clear.`:t?`有什么想讨论或推进的事?直接告诉我就好。`:`What would you like to discuss or move forward? Just tell me what is on your mind.`}function ie(e,t,n){return t===`listen`?e===`reserved`?n?`先说说这三件事。我听完再帮你排顺序。`:`Tell me about the three tasks first. I’ll listen, then help order them.`:e===`gentle`?n?`可以,慢慢说说每件事现在到哪一步。等你说完,我们再一起排顺序。`:`Take your time telling me where each task stands. Once you’re done, we can sort the order together.`:n?`你先说说三件事各自到哪一步。我听完再和你一起排顺序。`:`Tell me where each task stands. I’ll listen first, then help you order them.`:t===`solutions`?e===`reserved`?n?`列出三件事和截止时间。我直接给你建议顺序与依据。`:`List the three tasks and deadlines. I’ll give you a suggested order and why.`:e===`gentle`?n?`把三件事和截止时间告诉我。我先帮你排出一个可行顺序,再解释为什么。`:`Tell me the three tasks and deadlines. I’ll suggest a workable order and explain why.`:n?`把三件事和截止时间发我,我会给出建议顺序和理由。`:`Send me the three tasks and deadlines. I’ll suggest an order and explain why.`:e===`reserved`?n?`列出三件事、截止时间和影响范围。我帮你排优先级。`:`List the three tasks, deadlines, and impact. I’ll rank them.`:e===`gentle`?n?`我们先把三件事放到一起看。告诉我各自的截止时间,我帮你理清先后。`:`Let’s look at the three together. Tell me their deadlines, and I’ll help sort the order.`:n?`可以。把三件事和截止时间发我,我们先找出最该做的一件。`:`Sure. Send me the three tasks and deadlines, and we’ll identify the one to start with.`}function ae(e){return E.find(t=>t.warmth===e.warmth)?.id??`natural`}function oe(){let e=S(),t=(0,w.useRef)(e);t.current=e;let n=u(e=>e.language)===`zh`,r=m(e=>e.setPageHeader),o=m(e=>e.clearPageHeader),[p,v]=(0,w.useState)(null),[C,ee]=(0,w.useState)([]),[te,oe]=(0,w.useState)(!0),[k,A]=(0,w.useState)(!1),[j,M]=(0,w.useState)(null),[N,se]=(0,w.useState)(`natural`),[P,ce]=(0,w.useState)(`spark`),[le,F]=(0,w.useState)(``),[I,L]=(0,w.useState)(``),[R,z]=(0,w.useState)(`untangle`),[B,V]=(0,w.useState)(`none`),[H,U]=(0,w.useState)(`balanced`),[W,G]=(0,w.useState)(`decisions`),[K,q]=(0,w.useState)(!1),[J,ue]=(0,w.useState)(!1),[Y,de]=(0,w.useState)(null),[fe,pe]=(0,w.useState)(!1),X=(0,w.useCallback)(async()=>{try{let[e,t]=await Promise.all([l(d(`/api/personal-agent`)),l(d(`/api/personal-agent/models`))]);v(e.payload),window.dispatchEvent(new CustomEvent(`personal-agent-updated`,{detail:e.payload})),e.payload&&window.dispatchEvent(new Event(`session-updated`)),ee(t.payload),e.payload&&(F(e.payload.displayName),ce(e.payload.appearance),se(ae(e.payload.preferences)),L(e.payload.preferences.addressAs??``),z(e.payload.preferences.supportMode??`untangle`),V(e.payload.preferences.humor??`none`),U(e.payload.preferences.detailLevel??`balanced`),G(e.payload.preferences.proactivity??`decisions`))}catch(e){M(e instanceof Error?e.message:String(e))}finally{oe(!1)}},[]);(0,w.useEffect)(()=>{X()},[X]);let me=async(e,t,n)=>{let r=E.find(e=>e.id===n)??E[1],i=await l(d(`/api/personal-agent/profile`),{method:`PATCH`,body:JSON.stringify({revision:e.revision,displayName:t.trim()||e.displayName,appearance:P,preferences:{...e.preferences,addressAs:I.trim()||void 0,supportMode:R,detailLevel:H,proactivity:W,warmth:r.warmth,humor:B}})});v(i.payload),window.dispatchEvent(new CustomEvent(`personal-agent-updated`,{detail:i.payload}))},he=async()=>{if(C.length!==0){A(!0),M(null);try{let e=await l(d(`/api/personal-agent`),{method:`POST`,body:JSON.stringify({})});v(e.payload),window.dispatchEvent(new CustomEvent(`personal-agent-updated`,{detail:e.payload})),window.dispatchEvent(new Event(`session-updated`))}catch(e){M(e instanceof Error?e.message:String(e)),await X()}finally{A(!1)}}},Z=(0,w.useCallback)(async()=>{ue(!0),de(null),pe(!1);try{de((await l(d(`/api/personal-agent/activity`))).payload)}catch{pe(!0)}},[]),ge=async()=>{if(p){A(!0),M(null);try{await me(p,le,N),q(!1)}catch(e){M(e instanceof Error?e.message:String(e)),await X()}finally{A(!1)}}};if((0,w.useLayoutEffect)(()=>{let i=p?.state===`ready`,a=i?p.appearance:P,l=i?p.displayName:`Personal AI`;return r({startExtra:null,main:(0,T.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,T.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full ${O(a).color}`,children:(0,T.jsx)(_,{appearance:a,className:`size-8`})}),(0,T.jsx)(`h1`,{className:`min-w-0 truncate text-sm font-semibold text-fg sm:text-base`,children:l}),K&&(0,T.jsxs)(`span`,{className:`truncate text-sm text-fg-muted`,children:[`· `,n?`回应偏好`:`Response preferences`]})]}),end:i?K?(0,T.jsx)(`button`,{type:`button`,onClick:()=>q(!1),className:`touch-target rounded-lg p-2 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n?`关闭偏好设置`:`Close response preferences`,children:(0,T.jsx)(c,{className:`size-5`})}):(0,T.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,T.jsx)(`button`,{type:`button`,disabled:e.active,onClick:()=>{p?.state===`ready`&&t.current.open({conversationId:p.conversationId,name:p.displayName,mode:`assistant`})},className:`touch-target rounded-lg p-2 text-fg-muted hover:bg-surface-hover hover:text-fg disabled:opacity-50`,"aria-label":n?`语音通话`:`Voice call`,title:n?`语音通话`:`Voice call`,children:(0,T.jsx)(h,{className:`size-5`})}),(0,T.jsx)(`button`,{type:`button`,onClick:()=>void Z(),"aria-pressed":J,className:`touch-target rounded-lg p-2 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n?`正在做的事`:`Activity`,children:(0,T.jsx)(x,{className:`size-5`})}),(0,T.jsx)(`button`,{type:`button`,onClick:()=>q(!0),className:`touch-target rounded-lg p-2 text-fg-muted hover:bg-surface-hover hover:text-fg`,"aria-label":n?`回应偏好`:`Response preferences`,children:(0,T.jsx)(s,{className:`size-5`})})]}):null}),()=>o()},[P,o,Z,p,r,J,K,e.active,n]),te)return(0,T.jsxs)(`div`,{className:`mx-auto w-full max-w-2xl space-y-5 px-6 py-12`,children:[(0,T.jsx)(f,{className:`h-20 w-20 rounded-full`}),(0,T.jsx)(f,{className:`h-9 w-72`}),(0,T.jsx)(f,{className:`h-44 w-full rounded-2xl`})]});let Q=Y?.items.filter(e=>e.phase!==`closed`)??[],$=Y?.items.filter(e=>e.phase===`closed`)??[];return p?.state===`ready`&&!K?(0,T.jsx)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col bg-surface-panel`,children:(0,T.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,T.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,T.jsx)(y,{embedded:!0,personal:!0,personalWelcome:{name:p.displayName,addressAs:p.preferences.addressAs,avatar:(0,T.jsx)(_,{appearance:p.appearance,className:`size-14`}),opening:re(p.preferences,n)},conversationId:p.conversationId})}),J&&(0,T.jsxs)(`aside`,{className:`fixed inset-0 z-30 flex min-w-0 flex-col border-l border-edge bg-surface-panel sm:static sm:w-[min(25rem,42vw)]`,"aria-label":n?`派发的任务`:`Delegated tasks`,children:[(0,T.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 border-b border-edge-subtle px-5 py-5`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`h2`,{className:`text-base font-semibold tracking-tight text-fg`,children:n?`交给我推进的事`:`Delegated work`}),(0,T.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:Y?n?`${Q.length} 项进行中 · ${$.length} 项已结束`:`${Q.length} active · ${$.length} finished`:n?`查看任务进展与结果`:`Follow progress and results`})]}),(0,T.jsx)(`button`,{type:`button`,onClick:()=>ue(!1),className:`touch-target -mr-2 -mt-1 rounded-lg p-2 text-fg-muted transition-colors hover:bg-surface-hover hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":n?`关闭活动`:`Close activity`,children:(0,T.jsx)(c,{className:`size-4`})})]}),(0,T.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-4`,children:[!Y&&!fe&&(0,T.jsxs)(`div`,{className:`space-y-2 px-2`,children:[(0,T.jsx)(f,{className:`h-16 rounded-xl`}),(0,T.jsx)(f,{className:`h-16 rounded-xl`}),(0,T.jsx)(f,{className:`h-16 rounded-xl`})]}),fe&&(0,T.jsxs)(`div`,{className:`px-5 py-12 text-center`,children:[(0,T.jsx)(`p`,{className:`text-sm text-fg-muted`,children:n?`暂时无法读取任务`:`Could not load tasks`}),(0,T.jsx)(`button`,{type:`button`,onClick:()=>void Z(),className:`mt-3 rounded-lg px-3 py-2 text-sm text-accent hover:bg-surface-hover`,children:n?`重试`:`Try again`})]}),Y?.items.length===0&&(0,T.jsxs)(`div`,{className:`px-5 py-16 text-center`,children:[(0,T.jsx)(x,{className:`mx-auto size-7 text-fg-subtle`,"aria-hidden":!0}),(0,T.jsx)(`p`,{className:`mt-4 text-sm font-medium text-fg`,children:n?`还没有派发的任务`:`No delegated work yet`}),(0,T.jsx)(`p`,{className:`mt-1 text-xs leading-5 text-fg-muted`,children:n?`你可以在对话里直接告诉我想推进的事。`:`Tell me what you would like to move forward in chat.`})]}),Q.length>0&&(0,T.jsxs)(`section`,{"aria-label":n?`进行中`:`Active`,children:[(0,T.jsx)(`h3`,{className:`px-3 pb-1 text-[11px] font-medium tracking-wide text-fg-subtle`,children:n?`进行中`:`ACTIVE`}),(0,T.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:Q.map(e=>(0,T.jsx)(ne,{item:e,zh:n},e.id))})]}),$.length>0&&(0,T.jsxs)(`section`,{className:Q.length?`mt-7`:``,"aria-label":n?`已结束`:`Finished`,children:[(0,T.jsx)(`h3`,{className:`px-3 pb-1 text-[11px] font-medium tracking-wide text-fg-subtle`,children:n?`已结束`:`FINISHED`}),(0,T.jsx)(`div`,{className:`divide-y divide-edge-subtle`,children:$.map(e=>(0,T.jsx)(ne,{item:e,zh:n},e.id))})]})]})]})]})}):K?(0,T.jsx)(`div`,{className:`h-full min-h-0 overflow-y-auto bg-surface-base px-4 py-8 sm:px-6`,children:(0,T.jsxs)(`div`,{className:`mx-auto max-w-2xl`,children:[(0,T.jsxs)(`div`,{className:`mb-7`,children:[(0,T.jsx)(`h2`,{className:`text-2xl font-semibold tracking-tight text-fg`,children:K?n?`调整回应方式`:`Adjust how it responds`:n?`让回应更适合你`:`Make responses feel right for you`}),(0,T.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-fg-muted`,children:n?`先选你喜欢的表达方式。名字和形象可以稍后再决定,所有设置都能随时调整。`:`Start with the way you like to be answered. Name and appearance can wait, and every choice can change later.`})]}),(0,T.jsxs)(`div`,{className:`rounded-2xl border border-edge bg-surface-panel p-5 sm:p-6`,children:[(0,T.jsx)(`div`,{className:`text-sm font-medium text-fg`,children:n?`回答的语气`:`Response tone`}),(0,T.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n?`选一个起点;每次对话仍会按具体情况调整。`:`Choose a starting point. Each reply still adapts to the situation.`}),(0,T.jsx)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-3`,children:E.map(e=>(0,T.jsxs)(`button`,{type:`button`,onClick:()=>se(e.id),"aria-pressed":N===e.id,className:`min-h-28 rounded-xl border p-4 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${N===e.id?`border-accent bg-accent/5`:`border-edge hover:bg-surface-hover`}`,children:[(0,T.jsxs)(`span`,{className:`flex items-center gap-2 font-medium text-fg`,children:[(0,T.jsx)(b,{className:`size-4 text-accent`,"aria-hidden":!0}),n?e.zh:e.en]}),(0,T.jsx)(`span`,{className:`mt-2 block text-xs leading-relaxed text-fg-muted`,children:n?e.zhExample:e.enExample})]},e.id))}),(0,T.jsx)(`div`,{className:`mt-6 text-sm font-medium text-fg`,children:n?`遇到棘手的问题时,希望先得到什么?`:`When a problem is tricky, what helps first?`}),(0,T.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[[`listen`,n?`先听我说`:`Listen first`],[`untangle`,n?`帮我理清`:`Help me untangle it`],[`solutions`,n?`直接给办法`:`Give me solutions`]].map(([e,t])=>(0,T.jsx)(`button`,{type:`button`,"aria-pressed":R===e,onClick:()=>z(e),className:`min-h-11 rounded-full border px-4 text-sm ${R===e?`border-accent bg-accent/5 text-fg`:`border-edge text-fg-muted hover:bg-surface-hover`}`,children:t},e))}),(0,T.jsxs)(`div`,{className:`mt-6 grid gap-5 sm:grid-cols-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`mb-2 text-sm font-medium text-fg`,children:n?`回答多详细`:`Answer length`}),(0,T.jsx)(a,{value:H??`balanced`,options:[{value:`brief`,label:n?`简短,先说结论`:`Brief, answer first`},{value:`balanced`,label:n?`适中`:`Balanced`},{value:`detailed`,label:n?`多解释一点`:`More detail`}],placeholder:n?`选择回答长度`:`Choose answer length`,allowEmpty:!1,onChange:e=>U(e)})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`p`,{className:`mb-2 text-sm font-medium text-fg`,children:n?`主动更新的频率`:`Proactive updates`}),(0,T.jsx)(a,{value:W??`decisions`,options:[{value:`decisions`,label:n?`只说结果和决定`:`Results and decisions only`},{value:`important`,label:n?`重要进展也告诉我`:`Important milestones too`},{value:`open`,label:n?`可以多提建议`:`More suggestions`}],placeholder:n?`选择主动程度`:`Choose check-in style`,allowEmpty:!1,onChange:e=>G(e)})]})]}),(0,T.jsxs)(`details`,{className:`mt-5 text-sm text-fg-muted`,children:[(0,T.jsx)(`summary`,{className:`cursor-pointer select-none`,children:n?`更多表达偏好`:`More expression preferences`}),(0,T.jsxs)(`div`,{className:`mt-3 max-w-xs`,children:[(0,T.jsx)(`p`,{className:`mb-2 font-medium text-fg`,children:n?`轻松程度`:`Lightness`}),(0,T.jsx)(a,{value:B??`none`,options:[{value:`none`,label:n?`不加玩笑`:`No jokes`},{value:`occasional`,label:n?`合适时轻松一点`:`A light touch when it fits`},{value:`playful`,label:n?`可以更活泼`:`More playful`}],placeholder:n?`选择轻松程度`:`Choose lightness`,allowEmpty:!1,onChange:e=>V(e)})]})]}),(0,T.jsxs)(`div`,{className:`mt-6 rounded-2xl border border-edge bg-surface-base p-4`,"aria-live":`polite`,children:[(0,T.jsx)(`p`,{className:`text-xs font-medium text-fg-muted`,children:n?`语气与支持方式预览`:`Tone and support preview`}),(0,T.jsx)(`p`,{className:`mt-3 text-sm text-fg-muted`,children:n?`你:我手上有三件事,不知道先做哪件。`:`You: I have three things to do and don’t know where to start.`}),(0,T.jsxs)(`div`,{className:`mt-2 flex items-start gap-3`,children:[(0,T.jsx)(`span`,{className:`flex size-8 shrink-0 items-center justify-center rounded-full ${O(P).color}`,children:(0,T.jsx)(_,{appearance:P,className:`size-8`})}),(0,T.jsx)(`p`,{className:`rounded-2xl rounded-tl-sm bg-surface-hover px-4 py-3 text-sm leading-relaxed text-fg`,children:ie(E.find(e=>e.id===N)?.warmth,R,n)})]})]}),(0,T.jsxs)(`div`,{className:`mt-7 border-t border-edge pt-6`,children:[(0,T.jsx)(`h3`,{className:`text-sm font-medium text-fg`,children:n?`称呼与形象(可选)`:`Name and appearance (optional)`}),(0,T.jsx)(`p`,{className:`mt-1 text-xs text-fg-muted`,children:n?`名称与称呼可随时修改;界面形象不决定回答语气。`:`Names can change anytime; appearance does not determine response tone.`})]}),(0,T.jsxs)(`div`,{className:`mt-5 grid gap-4 sm:grid-cols-2`,children:[(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{htmlFor:`personal-name`,className:`block text-sm font-medium text-fg`,children:n?`助手名称`:`Assistant name`}),(0,T.jsx)(`input`,{id:`personal-name`,value:le,onChange:e=>F(e.target.value),maxLength:60,placeholder:`Personal AI`,className:`mt-2 w-full rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`})]}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`label`,{htmlFor:`personal-address`,className:`block text-sm font-medium text-fg`,children:n?`怎么称呼你`:`What should it call you?`}),(0,T.jsx)(`input`,{id:`personal-address`,value:I,onChange:e=>L(e.target.value),maxLength:60,placeholder:n?`可留空`:`Optional`,className:`mt-2 w-full rounded-xl border border-edge bg-surface-base px-3 py-2.5 text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent`})]})]}),(0,T.jsx)(`div`,{className:`mt-5 text-sm font-medium text-fg`,children:n?`界面形象`:`On-screen appearance`}),(0,T.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-3`,children:D.map(e=>(0,T.jsxs)(`button`,{type:`button`,onClick:()=>ce(e.id),"aria-pressed":P===e.id,className:`flex min-h-16 min-w-20 items-center gap-2 rounded-xl border px-3 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent ${P===e.id?`border-accent bg-accent/5`:`border-edge hover:bg-surface-hover`}`,children:[(0,T.jsx)(`span`,{className:`flex size-8 items-center justify-center rounded-full ${e.color}`,children:(0,T.jsx)(_,{appearance:e.id,className:`size-8`})}),(0,T.jsx)(`span`,{className:`text-xs text-fg-muted`,children:n?e.zh:e.en})]},e.id))}),j&&(0,T.jsx)(`p`,{role:`alert`,className:`mt-4 text-sm text-red-600`,children:j}),(0,T.jsx)(`button`,{type:`button`,disabled:k,onClick:()=>void ge(),className:`mt-6 min-h-11 w-full rounded-xl bg-accent px-4 py-2.5 font-medium text-white disabled:opacity-50`,children:k?n?`正在保存…`:`Saving…`:n?`保存回应偏好`:`Save response preferences`})]}),(0,T.jsx)(`p`,{className:`mt-5 text-center text-sm text-fg-muted`,children:n?`之后可以直接说“回答短一点”或“先听我说”,回应方式会继续调整。`:`You can later say “keep it shorter” or “listen first” to adjust how it responds.`})]})}):(0,T.jsx)(`div`,{className:`flex h-full min-h-0 flex-1 items-center justify-center overflow-y-auto bg-surface-base px-5 py-10 sm:px-8`,children:(0,T.jsxs)(`div`,{className:`w-full max-w-lg text-center`,children:[(0,T.jsx)(`div`,{className:`mx-auto flex size-20 items-center justify-center rounded-[1.75rem] bg-amber-100/40 dark:bg-amber-400/10`,children:(0,T.jsx)(_,{appearance:`spark`,className:`size-16`})}),(0,T.jsx)(`h2`,{className:`mt-7 text-3xl font-semibold tracking-tight text-fg`,children:n?`有事,直接和我说`:`Start with a conversation`}),(0,T.jsx)(`p`,{className:`mx-auto mt-3 max-w-md text-sm leading-7 text-fg-muted`,children:n?`聊想法、问问题,或交给我一件要推进的事。我们先从对话开始,回应方式可以边聊边调整。`:`Bring a question, an idea, or something to move forward. We can shape how I respond as we talk.`}),(0,T.jsxs)(`button`,{type:`button`,disabled:k||C.length===0,onClick:()=>void he(),className:`mx-auto mt-8 flex min-h-12 w-full max-w-xs items-center justify-center gap-2 rounded-xl bg-accent px-5 text-sm font-medium text-white transition-colors hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:opacity-50`,children:[k?n?`正在准备对话…`:`Getting ready…`:n?`开始对话`:`Start chatting`,!k&&(0,T.jsx)(g,{className:`size-4`,"aria-hidden":!0})]}),C.length===0&&(0,T.jsxs)(`p`,{className:`mt-5 text-sm text-fg-muted`,children:[n?`开始前需要配置一个可用模型。`:`Set up a compatible model to get started.`,` `,(0,T.jsx)(i,{to:`/settings/capabilities/models`,className:`text-accent underline underline-offset-2`,children:n?`前往模型设置`:`Model settings`})]}),j&&(0,T.jsx)(`p`,{role:`alert`,className:`mt-5 text-sm text-danger`,children:j}),C.length>0&&(0,T.jsx)(`p`,{className:`mt-5 text-xs text-fg-subtle`,children:n?`名字、形象和其他偏好,以后都能随时调整。`:`You can change the name, appearance, and preferences later.`})]})})}export{oe as PersonalPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{vn as e}from"./index-ByFXhQ-T.js";function t(t){let{children:n,fallback:r}=t,i=r===void 0?null:r;return e()?n:i}export{t};
|