bailinghub 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +146 -185
- package/README.md +135 -207
- package/THIRD_PARTY_NOTICES.md +6 -7
- package/assets/readme-demo-evidence.en-dark.svg +82 -0
- package/assets/readme-demo-evidence.en.svg +82 -0
- package/assets/readme-demo-evidence.zh-CN-dark.svg +82 -0
- package/assets/readme-demo-evidence.zh-CN.svg +82 -0
- package/assets/readme-entry-points.en-dark.svg +71 -0
- package/assets/readme-entry-points.en.svg +71 -0
- package/assets/readme-entry-points.zh-CN-dark.svg +71 -0
- package/assets/readme-entry-points.zh-CN.svg +71 -0
- package/assets/readme-product-overview.en-dark.svg +87 -0
- package/assets/readme-product-overview.en.svg +87 -0
- package/assets/readme-product-overview.zh-CN-dark.svg +87 -0
- package/assets/readme-product-overview.zh-CN.svg +87 -0
- package/docker-compose.images.yml +2 -2
- package/docs/AGENT_CLIENT_QUICKSTART.en.md +29 -8
- package/docs/AGENT_CLIENT_QUICKSTART.md +25 -6
- package/docs/AGENT_CONVERSATION_AUDIT.en.md +194 -0
- package/docs/AGENT_CONVERSATION_AUDIT.md +111 -0
- package/docs/CHANGELOG.en.md +11 -0
- package/docs/CHANGELOG.md +11 -0
- package/docs/INDEPENDENT_VALIDATION.en.md +4 -4
- package/docs/INDEPENDENT_VALIDATION.md +4 -4
- package/docs/README.en.md +5 -0
- package/docs/README.md +5 -0
- package/docs/RELEASE_NOTES_v0.6.0.en.md +51 -0
- package/docs/RELEASE_NOTES_v0.6.0.md +51 -0
- package/docs/user-guide/README.en.md +1 -0
- package/docs/user-guide/README.md +1 -0
- package/docs/user-guide/console-map.en.md +2 -0
- package/docs/user-guide/console-map.md +2 -1
- package/docs/user-guide/conversations.en.md +40 -0
- package/docs/user-guide/conversations.md +40 -0
- package/package.json +1 -1
- package/scripts/check-doc-links.mjs +2 -0
- package/scripts/check-image-tags.sh +1 -1
- package/scripts/check-release-consistency.test.mjs +2 -2
- package/scripts/e2e-console.mjs +89 -0
- package/scripts/generate-readme-assets.mjs +488 -7
- package/scripts/install.sh +1 -1
- package/scripts/publish-images.sh +1 -1
- package/scripts/release-audit.mjs +1 -0
- package/scripts/verify-github-repo.mjs +1 -0
- package/sql/057_agent_conversation_audit.sql +55 -0
- package/src/app/agent-conversation-audit.ts +30 -0
- package/src/core/runtime/agent-conversation-audit.test.ts +38 -0
- package/src/core/runtime/agent-conversation-audit.ts +159 -0
- package/src/infrastructure/config/config-agent-conversation-audit-repository.test.ts +146 -0
- package/src/infrastructure/config/config-agent-conversation-audit-repository.ts +262 -0
- package/src/infrastructure/config/configstore.ts +5 -0
- package/src/routes/admin-conversation-audit.ts +46 -0
- package/src/routes/admin-runtime.test.ts +38 -0
- package/src/routes/admin-runtime.ts +14 -3
- package/src/routes/admin.ts +3 -0
- package/src/routes/agent-api.ts +2 -0
- package/src/routes/agent-conversation-audit.test.ts +131 -0
- package/src/routes/agent-conversation-audit.ts +33 -0
- package/src/test-support/agent-conversation-audit-fixture.ts +123 -0
- package/web/console/assets/{Accounts-r10QUjLQ.js → Accounts-Ca_VnSu9.js} +1 -1
- package/web/console/assets/{AgentClients-UTTqbkjy.js → AgentClients-BPIvlLYY.js} +1 -1
- package/web/console/assets/{Approvals-BGKkYIya.js → Approvals-CMvPWacY.js} +1 -1
- package/web/console/assets/{Audit-CQmjOAoO.js → Audit-CIRqOCnL.js} +1 -1
- package/web/console/assets/{BrandLockup-BF_0pCa3.js → BrandLockup-BrytmTTH.js} +1 -1
- package/web/console/assets/{Channels-C4yZE67F.js → Channels-CApxH2TB.js} +1 -1
- package/web/console/assets/{ChatEntries-OqsqLjU6.js → ChatEntries-CJon3bWJ.js} +1 -1
- package/web/console/assets/{Clients-Dv3sv51C.js → Clients-BSA1rlTB.js} +1 -1
- package/web/console/assets/{Cost-C_-kiH59.js → Cost-BbhlQFP8.js} +1 -1
- package/web/console/assets/{Credentials-CPTEAiV6.js → Credentials-kqr1W0K7.js} +1 -1
- package/web/console/assets/{Diagnostics-O-NKFOeI.js → Diagnostics-Kljt9XTH.js} +1 -1
- package/web/console/assets/{Executors-GVIAiNgv.js → Executors-DnsB-Xz4.js} +1 -1
- package/web/console/assets/{Kb-BsCWkJI1.js → Kb-DLZSAFWP.js} +2 -2
- package/web/console/assets/{Login-VFjkHNMr.js → Login-DiTjPWmN.js} +1 -1
- package/web/console/assets/{Projects-Ds-sJwfy.js → Projects-CXcVCgCD.js} +1 -1
- package/web/console/assets/{Routes-Wwurw2UU.js → Routes-DN9_d9Po.js} +1 -1
- package/web/console/assets/Runs-Cwbe6thL.js +3 -0
- package/web/console/assets/Runs-D8UmjP5G.css +1 -0
- package/web/console/assets/{Setup-BLelw0_V.js → Setup-FqoCKmfZ.js} +1 -1
- package/web/console/assets/{Shell-CvaeK4j_.js → Shell-BEqpONiy.js} +1 -1
- package/web/console/assets/{StorageBuckets-Dv6u47yO.js → StorageBuckets-CkORbYXY.js} +1 -1
- package/web/console/assets/{SystemSettings-B9K7zaDU.js → SystemSettings-gTQAazu7.js} +1 -1
- package/web/console/assets/{SystemStatus-H-oKDo-y.js → SystemStatus-DAmUUNqO.js} +1 -1
- package/web/console/assets/{Targets-CCFhjPKf.js → Targets-CZmDcjsE.js} +1 -1
- package/web/console/assets/{Tools-D0H9xpFH.js → Tools-CIHInlHL.js} +1 -1
- package/web/console/assets/{index-CuoTgf6q.js → index-BkLbd7Cc.js} +2 -2
- package/web/console/assets/{index-DyX9Bz3V.js → index-QnmD7N7F.js} +1 -1
- package/web/console/assets/{request-F5lXa7Ro.js → request-r7GHVJzw.js} +1 -1
- package/web/console/assets/{schema-DUWaWqPn.js → schema-BVn_hB7M.js} +1 -1
- package/web/console/assets/vendor-mammoth-BUEEDX6A.js +231 -0
- package/web/console/index.html +1 -1
- package/web-admin/package-lock.json +3 -3
- package/web-admin/src/components/ClientConversations.vue +244 -0
- package/web-admin/src/components/conversation-audit.ts +121 -0
- package/web-admin/src/pages/Runs.vue +73 -17
- package/web-admin/tests/conversation-audit.fixture.mjs +182 -0
- package/web-admin/tests/conversation-audit.test.mjs +93 -0
- package/web/console/assets/Runs-4zDD9VOC.css +0 -1
- package/web/console/assets/Runs-DLPzXmSy.js +0 -3
- package/web/console/assets/vendor-mammoth-nXG51Cg7.js +0 -231
package/scripts/e2e-console.mjs
CHANGED
|
@@ -108,6 +108,46 @@ const agentRunId = '123e4567-e89b-42d3-a456-426614174000';
|
|
|
108
108
|
const agentToolJobId = '223e4567-e89b-42d3-a456-426614174000';
|
|
109
109
|
const incompleteAgentRunId = '323e4567-e89b-42d3-a456-426614174000';
|
|
110
110
|
const incompleteAgentToolJobId = '423e4567-e89b-42d3-a456-426614174000';
|
|
111
|
+
const conversationId = '523e4567-e89b-42d3-a456-426614174000';
|
|
112
|
+
const conversationTurnId = 'demo-conversation-turn-1';
|
|
113
|
+
const conversationUser = '对比演示账户 A、B,只更新 A 的资料。';
|
|
114
|
+
const conversationReply = '账户 A 更新成功;账户 B 的审批已通过,仍需客户端继续处理。';
|
|
115
|
+
const conversationMembers = ['A', 'B'].map((label, index) => ({
|
|
116
|
+
session_id: `623e4567-e89b-42d3-a456-42661417400${index}`,
|
|
117
|
+
display_label: `演示账户 ${label}`,
|
|
118
|
+
confirmed: true,
|
|
119
|
+
principal: { id: `demo-user-${index}`, tenant: `demo-account-${label}`, roles: ['operator'] },
|
|
120
|
+
}));
|
|
121
|
+
const conversation = {
|
|
122
|
+
conversation_id: conversationId,
|
|
123
|
+
client_archive_id: '723e4567-e89b-42d3-a456-426614174000',
|
|
124
|
+
client_conversation_id: 'demo-client-conversation',
|
|
125
|
+
client_app_id: 'demo-app',
|
|
126
|
+
route_key: 'demo_support',
|
|
127
|
+
state: 'ready',
|
|
128
|
+
member_count: 2,
|
|
129
|
+
confirmed_count: 2,
|
|
130
|
+
last_sequence: 6,
|
|
131
|
+
message_count: 2,
|
|
132
|
+
turn_count: 1,
|
|
133
|
+
last_turn_status: 'completed',
|
|
134
|
+
created_at: new Date().toISOString(),
|
|
135
|
+
updated_at: new Date().toISOString(),
|
|
136
|
+
};
|
|
137
|
+
const conversationEvents = [
|
|
138
|
+
{ kind: 'turn_start' },
|
|
139
|
+
{ kind: 'user_message', content: conversationUser },
|
|
140
|
+
{ kind: 'run_link', run_id: agentRunId, member_session_id: conversationMembers[0].session_id, thread_id: 2 },
|
|
141
|
+
{ kind: 'run_link', run_id: incompleteAgentRunId, member_session_id: conversationMembers[1].session_id, thread_id: 3 },
|
|
142
|
+
{ kind: 'assistant_message', content: conversationReply },
|
|
143
|
+
{ kind: 'turn_end', status: 'completed' },
|
|
144
|
+
].map((event, index) => ({
|
|
145
|
+
event_id: `823e4567-e89b-42d3-a456-42661417400${index}`,
|
|
146
|
+
sequence: index + 1,
|
|
147
|
+
client_turn_id: conversationTurnId,
|
|
148
|
+
created_at: conversation.created_at,
|
|
149
|
+
...event,
|
|
150
|
+
}));
|
|
111
151
|
|
|
112
152
|
let smokeRequests = 0;
|
|
113
153
|
|
|
@@ -132,6 +172,8 @@ function agentRunTracePayload() {
|
|
|
132
172
|
run: {
|
|
133
173
|
run_id: agentRunId,
|
|
134
174
|
thread_id: 2,
|
|
175
|
+
conversation_audit_id: conversationId,
|
|
176
|
+
client_turn_id: conversationTurnId,
|
|
135
177
|
client_app_id: 'demo-app',
|
|
136
178
|
route_key: 'demo_support',
|
|
137
179
|
status: 'completed',
|
|
@@ -172,6 +214,8 @@ function incompleteAgentRunTracePayload() {
|
|
|
172
214
|
run: {
|
|
173
215
|
run_id: incompleteAgentRunId,
|
|
174
216
|
thread_id: 3,
|
|
217
|
+
conversation_audit_id: conversationId,
|
|
218
|
+
client_turn_id: conversationTurnId,
|
|
175
219
|
client_app_id: 'demo-app',
|
|
176
220
|
route_key: 'demo_support',
|
|
177
221
|
status: 'context_ready',
|
|
@@ -252,6 +296,13 @@ async function mockApi(context) {
|
|
|
252
296
|
if (url.pathname === '/admin/api/clients') return route.fulfill({ json: fixtures.clients });
|
|
253
297
|
if (url.pathname === '/admin/api/routes') return route.fulfill({ json: fixtures.routes });
|
|
254
298
|
if (url.pathname === '/admin/api/runs') return route.fulfill({ json: fixtures.runs });
|
|
299
|
+
if (url.pathname === '/admin/api/conversation-audits') return route.fulfill({ json: {
|
|
300
|
+
schema: 'bailing.agent-conversation-audit-list.v1', items: [conversation], has_more: false, next_offset: null,
|
|
301
|
+
} });
|
|
302
|
+
if (url.pathname === `/admin/api/conversation-audits/${conversationId}`) return route.fulfill({ json: {
|
|
303
|
+
schema: 'bailing.agent-conversation-audit-detail.v1', conversation, members: conversationMembers,
|
|
304
|
+
events: conversationEvents, has_more: false, next_after_sequence: null,
|
|
305
|
+
} });
|
|
255
306
|
if (/^\/admin\/api\/runs\/[^/]+\/trace$/.test(url.pathname)) return route.fulfill({ json: tracePayload() });
|
|
256
307
|
if (url.pathname === `/admin/api/threads/2/agent-runs/${agentRunId}/trace`) return route.fulfill({ json: agentRunTracePayload() });
|
|
257
308
|
if (url.pathname === `/admin/api/threads/3/agent-runs/${incompleteAgentRunId}/trace`) return route.fulfill({ json: incompleteAgentRunTracePayload() });
|
|
@@ -351,6 +402,44 @@ try {
|
|
|
351
402
|
await page.getByRole('button', { name: '取消' }).click();
|
|
352
403
|
|
|
353
404
|
await page.getByRole('menuitem', { name: '任务' }).click();
|
|
405
|
+
const auditRadio = page.getByRole('radio', { name: '客户端完整对话', exact: true });
|
|
406
|
+
if (!await auditRadio.isChecked()) throw new Error('任务会话页应默认展示客户端完整对话');
|
|
407
|
+
const auditList = page.locator('aside[aria-label="客户端对话列表"]');
|
|
408
|
+
await auditList.getByRole('button', { name: /demo-client-conversation/ }).click();
|
|
409
|
+
const auditTurn = page.locator(`section[data-turn-id="${conversationTurnId}"]`);
|
|
410
|
+
await expectVisible(page, conversationReply);
|
|
411
|
+
if (await auditTurn.locator('.userMessage .messageText').innerText() !== conversationUser ||
|
|
412
|
+
await auditTurn.locator('.assistantMessage .messageText').innerText() !== conversationReply) {
|
|
413
|
+
throw new Error('客户端对话必须展示原始可见正文,不能以授权执行摘要替代');
|
|
414
|
+
}
|
|
415
|
+
await expectVisible(page, '已接收 1 轮 / 2 条消息');
|
|
416
|
+
await expectVisible(page, '旧历史或未同步内容可能缺失');
|
|
417
|
+
if (await auditTurn.locator('.authorizationRun').count() !== 2) throw new Error('本轮应保留两项独立授权执行');
|
|
418
|
+
const accountA = auditTurn.locator('.authorizationRun').filter({ hasText: agentRunId });
|
|
419
|
+
const accountB = auditTurn.locator('.authorizationRun').filter({ hasText: incompleteAgentRunId });
|
|
420
|
+
await accountA.getByText('演示账户 A', { exact: true }).waitFor();
|
|
421
|
+
await accountB.getByText('演示账户 B', { exact: true }).waitFor();
|
|
422
|
+
await accountA.getByRole('button', { name: '查看授权轨迹', exact: true }).click();
|
|
423
|
+
await accountA.locator('.invocation').getByText('staff_edit', { exact: true }).waitFor();
|
|
424
|
+
await accountA.getByRole('button', { name: '原授权记录', exact: true }).click();
|
|
425
|
+
await expectVisible(page, '把员工资料改成新的姓名');
|
|
426
|
+
if (!await page.getByRole('radio', { name: '原授权记录', exact: true }).isChecked()) {
|
|
427
|
+
throw new Error('授权执行必须能回到原授权记录');
|
|
428
|
+
}
|
|
429
|
+
await page.locator('.tracetoggle').filter({ hasText: '执行轨迹' }).first().click();
|
|
430
|
+
await page.getByRole('button', { name: '查看客户端完整对话', exact: true }).click();
|
|
431
|
+
await page.waitForURL((url) => url.searchParams.get('conversation') === conversationId &&
|
|
432
|
+
url.searchParams.get('turn') === conversationTurnId);
|
|
433
|
+
await auditTurn.locator('.assistantMessage .messageText').waitFor({ state: 'visible' });
|
|
434
|
+
if (!await auditRadio.isChecked() || await auditTurn.locator('.assistantMessage .messageText').innerText() !== conversationReply) {
|
|
435
|
+
throw new Error('原执行轨迹必须返回同一客户端对话与原始答复');
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// Keep the existing business-entry and authorization-scoped trace checks.
|
|
439
|
+
await page.locator('.conversationViewSwitch').getByText('原授权记录', { exact: true }).click();
|
|
440
|
+
if (!await page.getByRole('radio', { name: '原授权记录', exact: true }).isChecked()) {
|
|
441
|
+
throw new Error('切换后应展示原授权记录');
|
|
442
|
+
}
|
|
354
443
|
await expectVisible(page, '查询订单 SO-1001');
|
|
355
444
|
await page.getByText('查询订单 SO-1001').first().click();
|
|
356
445
|
await expectVisible(page, '订单 SO-1001 已查询完成');
|