@xopcai/xopc 0.0.196 → 0.0.197
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-B1oxPli_.js → agent-avatar-dicebear-C5st7lt5.js} +1 -1
- package/dist/gateway/static/root/assets/agents-Baxfj44y.js +68 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-vmuJ_Z6i.js → app-management-settings-panel-S8LhoD6G.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BMlEoe-G.js → appearance-settings-D8Cd5vDP.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-0uCxKyE5.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BdE4Mati.js → archive-plugin-qL07mwnY.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CTzaQcLV.js → attachment-load-CqSobpdi.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-XyDat125.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-B25zTNxl.js → binary-plugins-DBRPyLYE.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Cdrf2awF.js → block-editor-6wG1LU7t.js} +46 -46
- package/dist/gateway/static/root/assets/{browser-settings-page-BMTmGMM6.js → browser-settings-page-CrYNMR4w.js} +4 -4
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-BsmHy0ks.js → browser-workflow-inputs-Abil4puY.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-Wx9FrbK-.js → browser-workflows-page-BEu3E0et.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CvMcDhGf.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-settings-panel-9T2KXAs1.js → capability-presets-settings-panel-CHJDY-Ih.js} +2 -2
- package/dist/gateway/static/root/assets/{channels-settings-DquD4BPQ.js → channels-settings-Ds9BJbcY.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-BC-4ftOM.js → connectors-api-CgWjgPSI.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-NUs-Zf7F.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-BycQlU8Q.js → cron-expression-ZdDBAoqA.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-BvYqHRz0.js → dependency-picker-BGeB1jpn.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BOb8sEhN.js → desktop-pet-CsLR4pWB.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DStgPb82.js → desktop-pet-settings-CCjT1bdo.js} +1 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-C-Te1QN3.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-p83TmZFd.js → extension-debug-page-CD73euAM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DMQ3ovxA.js → extension-page-DAKjpNwd.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BcSKEU8s.js → extension-settings-page-BLSNdlgd.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-C-MmtCc7.js → gateway-config-api-CQrf0k3D.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-CuaRDWbg.js → gateway-settings-CvgH8IJI.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-Dm8TrfGa.js → heartbeat-settings-SPpnqbjl.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BFoD6047.js +3 -0
- package/dist/gateway/static/root/assets/index-84ys9u-K.js +152 -0
- package/dist/gateway/static/root/assets/index-D-srnucP.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BQb06_jl.js → keyboard-shortcuts-settings-HMhxgOuD.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-D5uL2_Fd.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DQtsxjGs.js → local-apps-page-DIWkFa3g.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-CDqIY72S.js → logs-page--6v8qq6y.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-D7itDEHl.js → management-settings-DtEuS-kR.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-Db-KrpOQ.js → markdown-split-DvVBewS4.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CHN66qs0.js → media-plugins-YVj7NVzD.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CJtKZM0P.js → notes-page-BDzuL2I9.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-IdjuNXvH.js +4 -0
- package/dist/gateway/static/root/assets/{page-tabs-HXweXqYE.js → page-tabs-7bSEWfSX.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Dob6Oe2l.js → preview-open-alternatives-tgLbHgcV.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page--RnCc9bb.js → product-open-page-Bwx_CQht.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-DnJXSuM4.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DckZKlBI.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-CfbUHBUH.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Bg1W2__k.js → runtime-tools-settings-panel-Fe05Nus6.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-BI4rVt3u.js → schema-form-CFfyC4CB.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-BCfCh4My.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cbi4FvzO.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-C7rzhi7x.js → settings-form-section-gEnEYT_3.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-BS36Mjzz.js → settings-loading-skeleton-BRE_-7Da.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-BDSd7F9Y.js → settings-page-C1zxCpqB.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-CTMmZcwj.js → settings-page-layout-CRpXF_05.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BcHdpmFf.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-BeCxg6eb.js → share-preview-page-DU8L68A5.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-CXL1EldF.js → shares-settings-kjTqH9yY.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-QAGpwzIM.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-CyfjEM4D.js → skills-page-lE1-YRdK.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-CnbJncdL.js → skills-page.utils-CYwFWTso.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CAv0Yk0Y.js → system-settings-panel-CVDsiPKn.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DsM13-cy.js +1 -0
- package/dist/gateway/static/root/assets/{typed-models-lib-DomX3Szl.js → typed-models-lib-DelyYgoc.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BLc4gfG0.js → use-autosave-C50Mq5yQ.js} +1 -1
- package/dist/gateway/static/root/assets/{user-context-page-C2kQENTK.js → user-context-page-D-VEOt2A.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-BijmpPjb.js → voice-api-key-field-DYfgTe3Y.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-D7w2JFFq.js → work-discovery-overlay-DPbujsp3.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-page-D77opady.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BEmugHfL.js → workflow-run-setup-panel-DqIb1oBB.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-B9-PLmlX.js +5 -0
- package/dist/gateway/static/root/index.html +2 -2
- package/dist/package.js +1 -1
- package/dist/src/agent/embedded/execution-context.d.ts +2 -0
- package/dist/src/agent/embedded/execution-context.js +11 -0
- package/dist/src/agent/embedded/index.d.ts +3 -1
- package/dist/src/agent/embedded/index.js +5 -3
- package/dist/src/agent/embedded/run-turn.js +15 -9
- package/dist/src/agent/embedded/session-runner.d.ts +6 -11
- package/dist/src/agent/embedded/session-runner.js +25 -36
- package/dist/src/agent/embedded/transcript-runtime.d.ts +35 -0
- package/dist/src/agent/embedded/transcript-runtime.js +66 -0
- package/dist/src/agent/embedded/types.d.ts +3 -1
- package/dist/src/agent/service.d.ts +15 -0
- package/dist/src/agent/service.js +30 -0
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/hono/routes/home.d.ts +1 -1
- package/dist/src/gateway/hono/routes/home.js +2 -2
- package/dist/src/gateway/hono/routes/index.js +2 -0
- package/dist/src/gateway/hono/routes/projects.js +12 -1
- package/dist/src/gateway/hono/routes/side-chats.d.ts +3 -0
- package/dist/src/gateway/hono/routes/side-chats.js +173 -0
- package/dist/src/gateway/service/agent-runner.d.ts +4 -0
- package/dist/src/gateway/service/agent-runner.js +15 -1
- package/dist/src/gateway/service/run-gateway-agent.js +1 -1
- package/dist/src/gateway/service.d.ts +4 -0
- package/dist/src/gateway/service.js +33 -7
- package/dist/src/gateway/side-chat/context-snapshot.d.ts +11 -0
- package/dist/src/gateway/side-chat/context-snapshot.js +108 -0
- package/dist/src/gateway/side-chat/index.d.ts +5 -0
- package/dist/src/gateway/side-chat/index.js +4 -0
- package/dist/src/gateway/side-chat/manager.d.ts +45 -0
- package/dist/src/gateway/side-chat/manager.js +198 -0
- package/dist/src/gateway/side-chat/run-service.d.ts +22 -0
- package/dist/src/gateway/side-chat/run-service.js +110 -0
- package/dist/src/gateway/side-chat/types.d.ts +61 -0
- package/dist/src/gateway/side-chat/types.js +1 -0
- package/dist/src/routing/session-key-utils.d.ts +0 -1
- package/dist/src/routing/session-key-utils.js +1 -6
- package/dist/src/routing/session-key.js +2 -2
- package/dist/src/tasks/home-query-service.d.ts +24 -0
- package/dist/src/tasks/home-query-service.js +284 -5
- package/dist/src/tasks/index.js +3 -3
- package/dist/src/tasks/project-operating-view-service.d.ts +2 -1
- package/dist/src/tasks/project-operating-view-service.js +27 -4
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/agents-VoFNMGL3.js +0 -68
- package/dist/gateway/static/root/assets/apps-page-CsNB6mv_.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-CW1YWgiX.js +0 -6
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C5l85__e.js +0 -7
- package/dist/gateway/static/root/assets/connectors-page-7zUxVHQg.js +0 -2
- package/dist/gateway/static/root/assets/directory-picker-path-field-DUUr9sq0.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BYhDbUvI.js +0 -3
- package/dist/gateway/static/root/assets/index-BzPwnXho.js +0 -150
- package/dist/gateway/static/root/assets/index-CFFYvilx.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CHk4x0kR.js +0 -2
- package/dist/gateway/static/root/assets/notes-workbench-epHGeKd5.js +0 -4
- package/dist/gateway/static/root/assets/project-detail-page-BxOD5-zj.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-D-9AhrH5.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CSUNXLKM.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BxOUBMca.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DAvTIbgw.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-D1v-2Ci-.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BxwkKgVw.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DGTVJs_N.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-XtoPgPUS.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-D_K2xOWq.js +0 -5
|
@@ -114,6 +114,273 @@ function buildHomeBriefing(input) {
|
|
|
114
114
|
nextScheduled: input.nextScheduled
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
+
function homeActionCopy(locale) {
|
|
118
|
+
return locale?.toLowerCase().startsWith("zh") ?? false ? {
|
|
119
|
+
approve: "允许并继续",
|
|
120
|
+
deny: "拒绝",
|
|
121
|
+
review: "查看并处理",
|
|
122
|
+
retry: "重试",
|
|
123
|
+
acknowledge: "暂时忽略",
|
|
124
|
+
viewProgress: "查看进度",
|
|
125
|
+
viewResult: "查看结果",
|
|
126
|
+
viewSchedule: "查看计划",
|
|
127
|
+
runningTask: "任务正在推进",
|
|
128
|
+
runningWorkflow: "工作流正在推进",
|
|
129
|
+
scheduled: "下一项定时工作",
|
|
130
|
+
organizeInbox: "整理收件箱",
|
|
131
|
+
organizeInboxSummary: "把刚捕获的内容整理成笔记、任务或后续行动。",
|
|
132
|
+
openInbox: "去整理",
|
|
133
|
+
startSomething: "今天想推进什么?",
|
|
134
|
+
startSomethingSummary: "把想要的结果交给我,我会从这里开始。",
|
|
135
|
+
askAi: "交给 Agent"
|
|
136
|
+
} : {
|
|
137
|
+
approve: "Allow and continue",
|
|
138
|
+
deny: "Deny",
|
|
139
|
+
review: "Review",
|
|
140
|
+
retry: "Retry",
|
|
141
|
+
acknowledge: "Dismiss",
|
|
142
|
+
viewProgress: "View progress",
|
|
143
|
+
viewResult: "View result",
|
|
144
|
+
viewSchedule: "View schedule",
|
|
145
|
+
runningTask: "Task in progress",
|
|
146
|
+
runningWorkflow: "Workflow in progress",
|
|
147
|
+
scheduled: "Next scheduled work",
|
|
148
|
+
organizeInbox: "Organize your inbox",
|
|
149
|
+
organizeInboxSummary: "Turn recent captures into notes, tasks, or next actions.",
|
|
150
|
+
openInbox: "Organize",
|
|
151
|
+
startSomething: "What would you like to move forward?",
|
|
152
|
+
startSomethingSummary: "Hand me the outcome you want and I’ll take it from here.",
|
|
153
|
+
askAi: "Ask an agent"
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function buildHomeFocusItems(input) {
|
|
157
|
+
const copy = homeActionCopy(input.locale);
|
|
158
|
+
const decisions = input.decisions.map((decision) => {
|
|
159
|
+
const openAction = decision.kind === "agent_judgment" && decision.judgment ? {
|
|
160
|
+
type: "open",
|
|
161
|
+
label: copy.review,
|
|
162
|
+
target: "inbox_judgment",
|
|
163
|
+
targetId: decision.judgment.inboxItemId
|
|
164
|
+
} : decision.kind === "task" ? {
|
|
165
|
+
type: "open",
|
|
166
|
+
label: copy.review,
|
|
167
|
+
target: "task",
|
|
168
|
+
targetId: decision.id.replace(/^task:/, "")
|
|
169
|
+
} : {
|
|
170
|
+
type: "open",
|
|
171
|
+
label: copy.review,
|
|
172
|
+
target: "work"
|
|
173
|
+
};
|
|
174
|
+
const connectorActions = decision.response?.kind === "connector_approval" ? {
|
|
175
|
+
primaryAction: {
|
|
176
|
+
type: "connector_decision",
|
|
177
|
+
label: copy.approve,
|
|
178
|
+
approvalId: decision.response.approvalId,
|
|
179
|
+
decision: "approve"
|
|
180
|
+
},
|
|
181
|
+
secondaryActions: [{
|
|
182
|
+
type: "connector_decision",
|
|
183
|
+
label: copy.deny,
|
|
184
|
+
approvalId: decision.response.approvalId,
|
|
185
|
+
decision: "deny"
|
|
186
|
+
}]
|
|
187
|
+
} : {
|
|
188
|
+
primaryAction: openAction,
|
|
189
|
+
secondaryActions: []
|
|
190
|
+
};
|
|
191
|
+
return {
|
|
192
|
+
id: decision.id,
|
|
193
|
+
kind: "decision",
|
|
194
|
+
priority: decision.urgency === "now" ? 100 : 90,
|
|
195
|
+
title: decision.title,
|
|
196
|
+
summary: decision.detail || copy.review,
|
|
197
|
+
statusLabel: copy.review,
|
|
198
|
+
updatedAt: decision.updatedAt,
|
|
199
|
+
pinnable: false,
|
|
200
|
+
openAction,
|
|
201
|
+
...connectorActions
|
|
202
|
+
};
|
|
203
|
+
});
|
|
204
|
+
const failures = input.attention.map((item) => ({
|
|
205
|
+
id: item.id,
|
|
206
|
+
kind: "failure",
|
|
207
|
+
priority: 80,
|
|
208
|
+
title: item.title,
|
|
209
|
+
summary: item.detail,
|
|
210
|
+
updatedAt: item.updatedAt,
|
|
211
|
+
pinnable: false,
|
|
212
|
+
openAction: item.kind === "workflow_run" ? item.sessionKey ? {
|
|
213
|
+
type: "open",
|
|
214
|
+
label: copy.review,
|
|
215
|
+
target: "session",
|
|
216
|
+
sessionKey: item.sessionKey
|
|
217
|
+
} : {
|
|
218
|
+
type: "open",
|
|
219
|
+
label: copy.review,
|
|
220
|
+
target: "workflow_run",
|
|
221
|
+
targetId: item.runId
|
|
222
|
+
} : {
|
|
223
|
+
type: "open",
|
|
224
|
+
label: copy.review,
|
|
225
|
+
target: "automation",
|
|
226
|
+
targetId: item.runId
|
|
227
|
+
},
|
|
228
|
+
primaryAction: {
|
|
229
|
+
type: "retry_run",
|
|
230
|
+
label: copy.retry,
|
|
231
|
+
subjectKind: item.kind,
|
|
232
|
+
runId: item.runId
|
|
233
|
+
},
|
|
234
|
+
secondaryActions: [{
|
|
235
|
+
type: "acknowledge_run",
|
|
236
|
+
label: copy.acknowledge,
|
|
237
|
+
subjectKind: item.kind,
|
|
238
|
+
runId: item.runId
|
|
239
|
+
}]
|
|
240
|
+
}));
|
|
241
|
+
const workflows = input.activeWorkflowRuns.map((run) => {
|
|
242
|
+
const openAction = run.sessionKey ? {
|
|
243
|
+
type: "open",
|
|
244
|
+
label: copy.viewProgress,
|
|
245
|
+
target: "session",
|
|
246
|
+
sessionKey: run.sessionKey
|
|
247
|
+
} : {
|
|
248
|
+
type: "open",
|
|
249
|
+
label: copy.viewProgress,
|
|
250
|
+
target: "workflow_run",
|
|
251
|
+
targetId: run.id
|
|
252
|
+
};
|
|
253
|
+
return {
|
|
254
|
+
id: `workflow:${run.id}`,
|
|
255
|
+
kind: "running",
|
|
256
|
+
priority: 60,
|
|
257
|
+
title: run.title,
|
|
258
|
+
summary: copy.runningWorkflow,
|
|
259
|
+
statusLabel: run.metrics.agentCount > 0 ? `${run.metrics.doneAgentCount}/${run.metrics.agentCount}` : void 0,
|
|
260
|
+
updatedAt: run.startedAtMs ?? run.createdAtMs,
|
|
261
|
+
pinnable: true,
|
|
262
|
+
openAction,
|
|
263
|
+
primaryAction: openAction,
|
|
264
|
+
secondaryActions: []
|
|
265
|
+
};
|
|
266
|
+
});
|
|
267
|
+
const tasks = input.runningTasks.map((task) => {
|
|
268
|
+
const openAction = {
|
|
269
|
+
type: "open",
|
|
270
|
+
label: copy.viewProgress,
|
|
271
|
+
target: "task",
|
|
272
|
+
targetId: task.id
|
|
273
|
+
};
|
|
274
|
+
return {
|
|
275
|
+
id: `task:${task.id}`,
|
|
276
|
+
kind: "running",
|
|
277
|
+
priority: 55,
|
|
278
|
+
title: task.title,
|
|
279
|
+
summary: copy.runningTask,
|
|
280
|
+
updatedAt: task.updatedAt,
|
|
281
|
+
pinnable: true,
|
|
282
|
+
openAction,
|
|
283
|
+
primaryAction: openAction,
|
|
284
|
+
secondaryActions: []
|
|
285
|
+
};
|
|
286
|
+
});
|
|
287
|
+
const results = input.wins.map((win) => {
|
|
288
|
+
const openAction = win.kind === "workflow_run" ? {
|
|
289
|
+
type: "open",
|
|
290
|
+
label: copy.viewResult,
|
|
291
|
+
target: "workflow_run",
|
|
292
|
+
targetId: win.id.replace(/^workflow:/, "")
|
|
293
|
+
} : win.kind === "automation_run" ? {
|
|
294
|
+
type: "open",
|
|
295
|
+
label: copy.viewResult,
|
|
296
|
+
target: "automation",
|
|
297
|
+
targetId: win.id.replace(/^automation:/, "")
|
|
298
|
+
} : {
|
|
299
|
+
type: "open",
|
|
300
|
+
label: copy.viewResult,
|
|
301
|
+
target: "task",
|
|
302
|
+
targetId: win.id.replace(/^task:/, "")
|
|
303
|
+
};
|
|
304
|
+
return {
|
|
305
|
+
id: win.id,
|
|
306
|
+
kind: "result",
|
|
307
|
+
priority: 40,
|
|
308
|
+
title: win.title,
|
|
309
|
+
summary: copy.viewResult,
|
|
310
|
+
updatedAt: win.completedAt,
|
|
311
|
+
pinnable: true,
|
|
312
|
+
openAction,
|
|
313
|
+
primaryAction: openAction,
|
|
314
|
+
secondaryActions: []
|
|
315
|
+
};
|
|
316
|
+
});
|
|
317
|
+
const scheduled = input.nextScheduled ? [{
|
|
318
|
+
id: `automation:${input.nextScheduled.id}:scheduled`,
|
|
319
|
+
kind: "scheduled",
|
|
320
|
+
priority: 30,
|
|
321
|
+
title: input.nextScheduled.name || input.nextScheduled.id,
|
|
322
|
+
summary: copy.scheduled,
|
|
323
|
+
statusLabel: new Date(input.nextScheduled.nextRunAt).toLocaleString(input.locale),
|
|
324
|
+
updatedAt: Date.parse(input.nextScheduled.nextRunAt),
|
|
325
|
+
pinnable: true,
|
|
326
|
+
openAction: {
|
|
327
|
+
type: "open",
|
|
328
|
+
label: copy.viewSchedule,
|
|
329
|
+
target: "automation",
|
|
330
|
+
targetId: input.nextScheduled.id
|
|
331
|
+
},
|
|
332
|
+
primaryAction: {
|
|
333
|
+
type: "open",
|
|
334
|
+
label: copy.viewSchedule,
|
|
335
|
+
target: "automation",
|
|
336
|
+
targetId: input.nextScheduled.id
|
|
337
|
+
},
|
|
338
|
+
secondaryActions: []
|
|
339
|
+
}] : [];
|
|
340
|
+
const items = [
|
|
341
|
+
...decisions,
|
|
342
|
+
...failures,
|
|
343
|
+
...workflows,
|
|
344
|
+
...tasks,
|
|
345
|
+
...results,
|
|
346
|
+
...scheduled
|
|
347
|
+
].sort((left, right) => right.priority - left.priority || right.updatedAt - left.updatedAt);
|
|
348
|
+
if (items.length > 0) return items;
|
|
349
|
+
if (input.inboxCount > 0) return [{
|
|
350
|
+
id: "suggestion:organize-inbox",
|
|
351
|
+
kind: "suggestion",
|
|
352
|
+
priority: 10,
|
|
353
|
+
title: `${copy.organizeInbox} · ${input.inboxCount}`,
|
|
354
|
+
summary: copy.organizeInboxSummary,
|
|
355
|
+
updatedAt: input.nowMs,
|
|
356
|
+
pinnable: false,
|
|
357
|
+
openAction: {
|
|
358
|
+
type: "open",
|
|
359
|
+
label: copy.openInbox,
|
|
360
|
+
target: "inbox"
|
|
361
|
+
},
|
|
362
|
+
primaryAction: {
|
|
363
|
+
type: "open",
|
|
364
|
+
label: copy.openInbox,
|
|
365
|
+
target: "inbox"
|
|
366
|
+
},
|
|
367
|
+
secondaryActions: []
|
|
368
|
+
}];
|
|
369
|
+
return [{
|
|
370
|
+
id: "suggestion:ask-agent",
|
|
371
|
+
kind: "suggestion",
|
|
372
|
+
priority: 10,
|
|
373
|
+
title: copy.startSomething,
|
|
374
|
+
summary: copy.startSomethingSummary,
|
|
375
|
+
updatedAt: input.nowMs,
|
|
376
|
+
pinnable: false,
|
|
377
|
+
primaryAction: {
|
|
378
|
+
type: "ask_ai",
|
|
379
|
+
label: copy.askAi
|
|
380
|
+
},
|
|
381
|
+
secondaryActions: []
|
|
382
|
+
}];
|
|
383
|
+
}
|
|
117
384
|
var HomeQueryService = class {
|
|
118
385
|
#runs = new TaskRunRepository();
|
|
119
386
|
#tasks = new TaskRepository();
|
|
@@ -256,6 +523,10 @@ var HomeQueryService = class {
|
|
|
256
523
|
href: "/automations",
|
|
257
524
|
completedAt: run.endedAtMs ?? run.createdAtMs
|
|
258
525
|
}))].sort((left, right) => right.completedAt - left.completedAt);
|
|
526
|
+
const runningTasks = tasks.filter((task) => {
|
|
527
|
+
const state = this.#projector.project(task).operationalState;
|
|
528
|
+
return state === "queued" || state === "running" || state === "verifying";
|
|
529
|
+
}).slice(0, 20);
|
|
259
530
|
const briefing = buildHomeBriefing({
|
|
260
531
|
locale,
|
|
261
532
|
decisions,
|
|
@@ -267,6 +538,17 @@ var HomeQueryService = class {
|
|
|
267
538
|
nowMs
|
|
268
539
|
});
|
|
269
540
|
return {
|
|
541
|
+
focusItems: buildHomeFocusItems({
|
|
542
|
+
locale,
|
|
543
|
+
decisions,
|
|
544
|
+
attention,
|
|
545
|
+
activeWorkflowRuns,
|
|
546
|
+
runningTasks,
|
|
547
|
+
wins,
|
|
548
|
+
nextScheduled: upcomingAutomations[0],
|
|
549
|
+
inboxCount: inbox.total,
|
|
550
|
+
nowMs
|
|
551
|
+
}),
|
|
270
552
|
recentlyOpened: recentlyOpened.items.filter((note) => note.lastOpenedAt),
|
|
271
553
|
inboxCount: inbox.total,
|
|
272
554
|
pendingTasks: pendingTasks.items,
|
|
@@ -302,14 +584,11 @@ var HomeQueryService = class {
|
|
|
302
584
|
recent: workChats.filter((chat) => !chat.active).slice(0, 8)
|
|
303
585
|
},
|
|
304
586
|
upcomingAutomations,
|
|
305
|
-
tasks: { running:
|
|
306
|
-
const state = this.#projector.project(task).operationalState;
|
|
307
|
-
return state === "queued" || state === "running" || state === "verifying";
|
|
308
|
-
}).slice(0, 20) },
|
|
587
|
+
tasks: { running: runningTasks },
|
|
309
588
|
recentTasks: tasks.flatMap((task) => this.#runs.listReceipts(task.id, 3)).sort((a, b) => b.finalizedAt - a.finalizedAt).slice(0, 8),
|
|
310
589
|
recentAutomationRuns: automationRuns.slice(0, 5).map(toHomeAutomationRun)
|
|
311
590
|
};
|
|
312
591
|
}
|
|
313
592
|
};
|
|
314
593
|
//#endregion
|
|
315
|
-
export { HomeQueryService, buildHomeBriefing, decisionFromTask };
|
|
594
|
+
export { HomeQueryService, buildHomeBriefing, buildHomeFocusItems, decisionFromTask };
|
package/dist/src/tasks/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { TaskRunRepository } from "./task-run-repository.js";
|
|
|
3
3
|
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
4
4
|
import { resolveExecutionContext } from "./execution-context.js";
|
|
5
5
|
import { AttentionGovernor } from "./attention-governor.js";
|
|
6
|
-
import { HomeQueryService, buildHomeBriefing, decisionFromTask } from "./home-query-service.js";
|
|
6
|
+
import { HomeQueryService, buildHomeBriefing, buildHomeFocusItems, decisionFromTask } from "./home-query-service.js";
|
|
7
7
|
import { TaskContextRepository } from "./task-context-repository.js";
|
|
8
8
|
import { TaskDependencyError, TaskDependencyService } from "./task-dependency-service.js";
|
|
9
9
|
import { TaskApplicationService } from "./task-application-service.js";
|
|
@@ -13,9 +13,9 @@ import { ModelTaskContractPlanner, parseTaskContractResponse } from "./task-cont
|
|
|
13
13
|
import { assembleTaskContext, buildTaskExecutionDirective, getTaskContextManifest, getTaskExecutionBrief } from "./task-context-assembler.js";
|
|
14
14
|
import { TaskRunCoordinator } from "./task-run-coordinator.js";
|
|
15
15
|
import { ProjectMonitoringService, decideProactiveDisposition } from "./project-monitoring-service.js";
|
|
16
|
-
import { ProjectOperatingViewService, projectTaskLane } from "./project-operating-view-service.js";
|
|
16
|
+
import { ProjectOperatingViewService, projectTaskLane, summarizeProjectOperatingView } from "./project-operating-view-service.js";
|
|
17
17
|
import { TaskValueMetricsService } from "./task-value-metrics-service.js";
|
|
18
18
|
import { TaskOutboxDispatcher } from "./task-outbox-dispatcher.js";
|
|
19
19
|
import { TaskRunDispatcher } from "./task-run-dispatcher.js";
|
|
20
20
|
import { TaskSignalService } from "./task-signal-service.js";
|
|
21
|
-
export { AttentionGovernor, HomeQueryService, ModelTaskContractPlanner, ProjectMonitoringService, ProjectOperatingViewService, TaskApplicationService, TaskContextRepository, TaskDependencyError, TaskDependencyService, TaskOutboxDispatcher, TaskReadModelProjector, TaskRepository, TaskRunCoordinator, TaskRunDispatcher, TaskRunRepository, TaskSignalService, TaskValueMetricsService, TaskWorkflowCoordinator, assembleTaskContext, buildHomeBriefing, buildTaskExecutionDirective, decideProactiveDisposition, decisionFromTask, defineTaskContract, getTaskContextManifest, getTaskExecutionBrief, parseTaskContractResponse, projectTaskLane, resolveExecutionContext };
|
|
21
|
+
export { AttentionGovernor, HomeQueryService, ModelTaskContractPlanner, ProjectMonitoringService, ProjectOperatingViewService, TaskApplicationService, TaskContextRepository, TaskDependencyError, TaskDependencyService, TaskOutboxDispatcher, TaskReadModelProjector, TaskRepository, TaskRunCoordinator, TaskRunDispatcher, TaskRunRepository, TaskSignalService, TaskValueMetricsService, TaskWorkflowCoordinator, assembleTaskContext, buildHomeBriefing, buildHomeFocusItems, buildTaskExecutionDirective, decideProactiveDisposition, decisionFromTask, defineTaskContract, getTaskContextManifest, getTaskExecutionBrief, parseTaskContractResponse, projectTaskLane, resolveExecutionContext, summarizeProjectOperatingView };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { ProjectOperatingView, ProjectTaskCard } from '@xopcai/gateway-contract';
|
|
1
|
+
import type { ProjectOperatingSummary, ProjectOperatingView, ProjectTaskCard } from '@xopcai/gateway-contract';
|
|
2
2
|
import type { ProjectService } from '../projects/index.js';
|
|
3
3
|
export declare function projectTaskLane(card: Pick<ProjectTaskCard, 'phase' | 'operationalState' | 'attention'>): ProjectTaskCard['lane'];
|
|
4
|
+
export declare function summarizeProjectOperatingView(view: ProjectOperatingView): ProjectOperatingSummary;
|
|
4
5
|
export declare class ProjectOperatingViewService {
|
|
5
6
|
#private;
|
|
6
7
|
private readonly projects;
|
|
@@ -15,6 +15,22 @@ function projectTaskLane(card) {
|
|
|
15
15
|
if (card.operationalState === "waiting" || card.operationalState === "blocked") return "waiting";
|
|
16
16
|
return "ready";
|
|
17
17
|
}
|
|
18
|
+
function summarizeProjectOperatingView(view) {
|
|
19
|
+
const counts = {
|
|
20
|
+
ready: 0,
|
|
21
|
+
moving: 0,
|
|
22
|
+
waiting: 0,
|
|
23
|
+
needsUser: 0,
|
|
24
|
+
done: 0
|
|
25
|
+
};
|
|
26
|
+
for (const task of view.tasks) if (task.lane === "needs_user") counts.needsUser += 1;
|
|
27
|
+
else counts[task.lane] += 1;
|
|
28
|
+
return {
|
|
29
|
+
...view.digest,
|
|
30
|
+
counts,
|
|
31
|
+
updatedAt: Math.max(view.project.updatedAt, ...view.tasks.map((task) => task.updatedAt))
|
|
32
|
+
};
|
|
33
|
+
}
|
|
18
34
|
var ProjectOperatingViewService = class {
|
|
19
35
|
#tasks = new TaskRepository();
|
|
20
36
|
#runs = new TaskRunRepository();
|
|
@@ -52,7 +68,11 @@ var ProjectOperatingViewService = class {
|
|
|
52
68
|
lane: projectTaskLane(base)
|
|
53
69
|
};
|
|
54
70
|
});
|
|
55
|
-
const
|
|
71
|
+
const recentResults = projectTasks.flatMap((task) => this.#runs.listReceipts(task.id, 10).map((receipt) => ({
|
|
72
|
+
taskId: task.id,
|
|
73
|
+
taskTitle: task.title,
|
|
74
|
+
receipt
|
|
75
|
+
}))).sort((a, b) => b.receipt.finalizedAt - a.receipt.finalizedAt).slice(0, 10);
|
|
56
76
|
const attentionCount = cards.filter((card) => card.lane === "needs_user").length;
|
|
57
77
|
return {
|
|
58
78
|
project,
|
|
@@ -60,20 +80,23 @@ var ProjectOperatingViewService = class {
|
|
|
60
80
|
dependencyEdges: this.#dependencies.listProjectEdges(project.id),
|
|
61
81
|
blockers: cards.flatMap((card) => card.attention.map((item) => ({
|
|
62
82
|
id: item.sourceId ?? `${card.id}:${item.kind}`,
|
|
83
|
+
taskId: card.id,
|
|
63
84
|
kind: item.kind,
|
|
64
85
|
title: card.title,
|
|
65
86
|
detail: item.summary,
|
|
87
|
+
href: `/tasks/${encodeURIComponent(card.id)}`,
|
|
66
88
|
updatedAt: card.updatedAt
|
|
67
89
|
}))),
|
|
68
90
|
running: project.recentWorkflowRuns.filter((run) => run.status === "queued" || run.status === "running"),
|
|
69
|
-
|
|
91
|
+
recentResults,
|
|
70
92
|
digest: {
|
|
71
93
|
health: cards.length === 0 ? "empty" : attentionCount > 0 ? "attention" : "healthy",
|
|
72
|
-
summary: cards.length === 0 ? "No tasks yet" : `${cards.filter((card) => card.lane === "moving").length} moving, ${attentionCount} need attention
|
|
94
|
+
summary: cards.length === 0 ? "No tasks yet" : `${cards.filter((card) => card.lane === "moving").length} moving, ${attentionCount} need attention`,
|
|
95
|
+
recommendedAction: cards.find((card) => card.lane === "needs_user")?.attention[0]?.summary ?? cards.find((card) => card.lane === "moving")?.title ?? cards.find((card) => card.lane === "ready")?.title
|
|
73
96
|
},
|
|
74
97
|
monitoring: this.#monitoring.get(project.id)
|
|
75
98
|
};
|
|
76
99
|
}
|
|
77
100
|
};
|
|
78
101
|
//#endregion
|
|
79
|
-
export { ProjectOperatingViewService, projectTaskLane };
|
|
102
|
+
export { ProjectOperatingViewService, projectTaskLane, summarizeProjectOperatingView };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.197",
|
|
4
4
|
"description": "Local-first AI system that remembers context, coordinates AI, and sustains long-term progress.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -163,8 +163,8 @@
|
|
|
163
163
|
"vitest": "4.1.5",
|
|
164
164
|
"vue": "^3.5.35",
|
|
165
165
|
"@xopcai/endpoint-tools-protocol": "0.0.0",
|
|
166
|
-
"@xopcai/realtime-protocol": "0.0.0",
|
|
167
166
|
"@xopcai/gateway-contract": "0.0.0",
|
|
167
|
+
"@xopcai/realtime-protocol": "0.0.0",
|
|
168
168
|
"@xopcai/realtime-client": "0.0.0"
|
|
169
169
|
},
|
|
170
170
|
"scripts": {
|