@kafca/agentdock 0.1.31 → 0.1.34
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/LICENSE.md +73 -0
- package/README.md +11 -0
- package/dist/renderer/assets/{Badge-DaHt-aUT.js → Badge-BDxYXRKv.js} +1 -1
- package/dist/renderer/assets/{Chat-Dzeq3kiD.js → Chat-B-ZXd4Ld.js} +1 -1
- package/dist/renderer/assets/{ChatMarkdown-B-L5Roai.js → ChatMarkdown-Dn4XvCke.js} +1 -1
- package/dist/renderer/assets/{Config-BI4LJ7Fw.js → Config-DMOYyKOD.js} +1 -1
- package/dist/renderer/assets/{CronList-Dic7pblj.js → CronList-CMBhMs1J.js} +1 -1
- package/dist/renderer/assets/{Dashboard-C0_ATyGe.js → Dashboard-DApD4wOA.js} +2 -2
- package/dist/renderer/assets/{EmptyState-SQsG1DZP.js → EmptyState-CqcPky2i.js} +1 -1
- package/dist/renderer/assets/{KnowledgeDetail-D4yUJzp7.js → KnowledgeDetail-DMOXK9Nz.js} +1 -1
- package/dist/renderer/assets/{KnowledgeHome-L0tsg-oo.js → KnowledgeHome-Dv4Ttb6N.js} +1 -1
- package/dist/renderer/assets/{Logs-C2Jdr3uQ.js → Logs-CHrUm25Y.js} +1 -1
- package/dist/renderer/assets/{Modal-GUH3iPXo.js → Modal-Cj_0qtXr.js} +1 -1
- package/dist/renderer/assets/{Page-m42FBy97.js → Page-BlKjqLN4.js} +1 -1
- package/dist/renderer/assets/{ProjectDetail-RF_sagPO.js → ProjectDetail-aMl1VGTt.js} +1 -1
- package/dist/renderer/assets/{ProjectList-Cyr8RDK3.js → ProjectList-R2YvsII0.js} +1 -1
- package/dist/renderer/assets/{Select-CRlDgI5s.js → Select-CrqwGrrm.js} +1 -1
- package/dist/renderer/assets/{SessionChat-_HhzMwEO.js → SessionChat-CGtpyGKR.js} +1 -1
- package/dist/renderer/assets/{SessionList-DNwZjGTv.js → SessionList-D8gRUc8M.js} +1 -1
- package/dist/renderer/assets/{ThreadChat-DxBmdsAm.js → ThreadChat-BCGm6bQP.js} +1 -1
- package/dist/renderer/assets/{Workspace-DFphG85O.js → Workspace-DnePK6tn.js} +1 -1
- package/dist/renderer/assets/{arrow-left-bILMzse7.js → arrow-left-SVmCyBR4.js} +1 -1
- package/dist/renderer/assets/{book-open-BNBWEEve.js → book-open-CZi1avEJ.js} +1 -1
- package/dist/renderer/assets/{check-MGp5kvnb.js → check-C76I9BFh.js} +1 -1
- package/dist/renderer/assets/{chevron-down-zsfoTlh7.js → chevron-down-C7YSxzHw.js} +1 -1
- package/dist/renderer/assets/{circle-BX_xUSg-.js → circle-_s8tmsAJ.js} +1 -1
- package/dist/renderer/assets/{desktop-CgrO_cdQ.js → desktop-66ot_8sB.js} +1 -1
- package/dist/renderer/assets/{funnel-7442U1wq.js → funnel-cDV0Q_Mr.js} +1 -1
- package/dist/renderer/assets/{heart-B3d8bnSH.js → heart-qMUQm0tf.js} +1 -1
- package/dist/renderer/assets/{index-BBaYsVjU.js → index-BY88QEsS.js} +2 -2
- package/dist/renderer/assets/{index-5YUqCvBf.js → index-Cr6erCLm.js} +1 -1
- package/dist/renderer/assets/{pencil-QzWgkmoH.js → pencil-C3MA3apq.js} +1 -1
- package/dist/renderer/assets/{play-Bsc8hSI7.js → play-VZKHv5dN.js} +1 -1
- package/dist/renderer/assets/{plug-CRY7sjvB.js → plug-Cm7l0fVk.js} +1 -1
- package/dist/renderer/assets/{plus-Dr5Ei8Ud.js → plus-DjGK7f-K.js} +1 -1
- package/dist/renderer/assets/projects-Dcki78KB.js +1 -0
- package/dist/renderer/assets/{save-giJnp2Ki.js → save-Doi-FwDR.js} +1 -1
- package/dist/renderer/assets/{search-DcvHLmKs.js → search-DHqpbK_c.js} +1 -1
- package/dist/renderer/assets/{server-D_Qu8If5.js → server-Bmtxxlph.js} +1 -1
- package/dist/renderer/assets/{session-utils-CsASahfU.js → session-utils-Z-jLtVLY.js} +1 -1
- package/dist/renderer/assets/{sessions-eMpPqp4P.js → sessions-C5TSSo_R.js} +1 -1
- package/dist/renderer/assets/{shield-check-BpF0uIw-.js → shield-check-DhZ05nhI.js} +1 -1
- package/dist/renderer/assets/{trash-2-OJFmx3xk.js → trash-2-DiyFflVR.js} +1 -1
- package/dist/renderer/assets/{user-GL_ivaV6.js → user-CgsIPd7T.js} +1 -1
- package/dist/renderer/assets/{wifi-off-CQT5VNQl.js → wifi-off-CqWbWFzp.js} +1 -1
- package/dist/renderer/index.html +1 -1
- package/dist-electron/services/local-ai-core/src/acp/local-core-acp-backend.js +3 -6
- package/dist-electron/services/local-ai-core/src/acp/local-core-acp-response-processor.js +2 -4
- package/dist-electron/services/local-ai-core/src/acp/local-core-acp-session-coordinator.js +23 -6
- package/dist-electron/services/local-ai-core/src/cli/lac.js +9 -2
- package/dist-electron/services/local-ai-core/src/kernel/bootstrap.js +9 -14
- package/dist-electron/services/local-ai-core/src/runtime/local-core-controller.js +9 -39
- package/dist-electron/services/local-ai-core/src/scheduler/lark-schedule-adapter.js +20 -10
- package/dist-electron/services/local-ai-core/src/scheduler/local-schedule-adapter.js +10 -2
- package/dist-electron/services/local-ai-core/src/scheduler/scheduled-conversation-executor.js +22 -0
- package/dist-electron/services/local-ai-core/src/scheduler/scheduled-job-application-service.js +84 -0
- package/dist-electron/services/local-ai-core/src/scheduler/scheduled-job-route.js +57 -0
- package/dist-electron/services/local-ai-core/src/scheduler/weixin-schedule-adapter.js +19 -10
- package/dist-electron/{electron → tests/contracts}/local-core-contracts.test.js +1 -1
- package/dist-electron/{electron → tests/electron}/agent-runtime-detector.test.js +2 -2
- package/dist-electron/{electron → tests/electron}/lac-cli.test.js +56 -3
- package/dist-electron/{electron → tests/electron}/plugin-kernel.test.js +14 -13
- package/dist-electron/{electron → tests/electron}/renderer-packaging.test.js +11 -6
- package/dist-electron/{electron → tests/electron}/runtime-detection-service.test.js +1 -1
- package/dist-electron/{electron → tests/electron}/security-approval-store.test.js +2 -2
- package/dist-electron/{electron → tests/electron}/workspace-task-store.test.js +217 -6
- package/dist-electron/{electron → tests/integration}/channel-content.test.js +2 -2
- package/dist-electron/{electron → tests/integration}/local-core-acp-content.test.js +1 -1
- package/dist-electron/{electron → tests/integration}/local-core-refactor.test.js +27 -18
- package/package.json +3 -2
- package/dist/renderer/assets/projects-BDYSOFIJ.js +0 -1
- /package/dist-electron/{electron → tests/contracts}/architecture-docs.test.js +0 -0
- /package/dist-electron/{electron → tests/electron}/knowledge-skill-script.test.js +0 -0
|
@@ -8,11 +8,12 @@ const strict_1 = __importDefault(require("node:assert/strict"));
|
|
|
8
8
|
const node_fs_1 = require("node:fs");
|
|
9
9
|
const node_path_1 = require("node:path");
|
|
10
10
|
const node_os_1 = require("node:os");
|
|
11
|
-
const local_core_acp_store_js_1 = require("
|
|
12
|
-
const local_core_acp_session_coordinator_js_1 = require("
|
|
13
|
-
const scheduler_service_js_1 = require("
|
|
14
|
-
const
|
|
15
|
-
const
|
|
11
|
+
const local_core_acp_store_js_1 = require("../../services/local-ai-core/src/acp/local-core-acp-store.js");
|
|
12
|
+
const local_core_acp_session_coordinator_js_1 = require("../../services/local-ai-core/src/acp/local-core-acp-session-coordinator.js");
|
|
13
|
+
const scheduler_service_js_1 = require("../../services/local-ai-core/src/scheduler/scheduler-service.js");
|
|
14
|
+
const lark_schedule_adapter_js_1 = require("../../services/local-ai-core/src/scheduler/lark-schedule-adapter.js");
|
|
15
|
+
const bootstrap_js_1 = require("../../services/local-ai-core/src/kernel/bootstrap.js");
|
|
16
|
+
const local_core_controller_js_1 = require("../../services/local-ai-core/src/runtime/local-core-controller.js");
|
|
16
17
|
(0, node_test_1.default)('workspace registry entries persist in LocalCoreAcpStore', () => {
|
|
17
18
|
const userDataPath = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'workspace-registry-'));
|
|
18
19
|
try {
|
|
@@ -38,7 +39,7 @@ const local_core_controller_js_1 = require("../services/local-ai-core/src/runtim
|
|
|
38
39
|
(0, node_fs_1.rmSync)(userDataPath, { recursive: true, force: true });
|
|
39
40
|
}
|
|
40
41
|
});
|
|
41
|
-
(0, node_test_1.default)('scheduler create resolves a Lark route
|
|
42
|
+
(0, node_test_1.default)('scheduler create resolves a Lark delivery route without binding the job to a thread', async () => {
|
|
42
43
|
const userDataPath = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'scheduler-binding-route-'));
|
|
43
44
|
try {
|
|
44
45
|
const runtime = (0, bootstrap_js_1.bootstrapLocalCoreRuntime)({
|
|
@@ -74,7 +75,50 @@ const local_core_controller_js_1 = require("../services/local-ai-core/src/runtim
|
|
|
74
75
|
type: 'channel.chat',
|
|
75
76
|
channelId: 'chat-1',
|
|
76
77
|
participantId: 'user-1',
|
|
78
|
+
});
|
|
79
|
+
await controller.close();
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
(0, node_fs_1.rmSync)(userDataPath, { recursive: true, force: true });
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
(0, node_test_1.default)('scheduler create from a bound thread preserves channel instance route', async () => {
|
|
86
|
+
const userDataPath = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'scheduler-instance-route-'));
|
|
87
|
+
try {
|
|
88
|
+
const runtime = (0, bootstrap_js_1.bootstrapLocalCoreRuntime)({
|
|
89
|
+
userDataPath,
|
|
90
|
+
enableKnowledge: false,
|
|
91
|
+
log: () => { },
|
|
92
|
+
});
|
|
93
|
+
const controller = new local_core_controller_js_1.LocalCoreController(userDataPath, runtime);
|
|
94
|
+
const thread = runtime.store.createThread('workspace-a', 'Lark instance thread');
|
|
95
|
+
const now = new Date().toISOString();
|
|
96
|
+
runtime.store.upsertPlatformThreadBinding({
|
|
97
|
+
workspace_id: 'workspace-a',
|
|
98
|
+
platform: 'lark:lark-1',
|
|
99
|
+
chat_id: 'chat-1',
|
|
100
|
+
platform_user_id: 'user-1',
|
|
101
|
+
thread_id: thread.id,
|
|
102
|
+
last_platform_message_id: null,
|
|
103
|
+
created_at: now,
|
|
104
|
+
updated_at: now,
|
|
105
|
+
});
|
|
106
|
+
const job = await controller.createScheduledJob({
|
|
107
|
+
workspaceId: 'workspace-a',
|
|
77
108
|
threadId: thread.id,
|
|
109
|
+
executionMode: 'side-thread',
|
|
110
|
+
triggerType: 'cron',
|
|
111
|
+
cronExpr: '30 18 * * *',
|
|
112
|
+
promptTemplate: 'ping',
|
|
113
|
+
description: 'bound lark task',
|
|
114
|
+
enabled: true,
|
|
115
|
+
});
|
|
116
|
+
strict_1.default.equal(job.platform, 'lark:lark-1');
|
|
117
|
+
strict_1.default.deepEqual(job.route, {
|
|
118
|
+
type: 'channel.chat',
|
|
119
|
+
channelId: 'chat-1',
|
|
120
|
+
instanceId: 'lark-1',
|
|
121
|
+
participantId: 'user-1',
|
|
78
122
|
});
|
|
79
123
|
await controller.close();
|
|
80
124
|
}
|
|
@@ -82,6 +126,173 @@ const local_core_controller_js_1 = require("../services/local-ai-core/src/runtim
|
|
|
82
126
|
(0, node_fs_1.rmSync)(userDataPath, { recursive: true, force: true });
|
|
83
127
|
}
|
|
84
128
|
});
|
|
129
|
+
(0, node_test_1.default)('Lark scheduled same-thread execution resolves the latest channel thread and keeps channel delivery', async () => {
|
|
130
|
+
const userDataPath = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'scheduler-lark-latest-thread-'));
|
|
131
|
+
try {
|
|
132
|
+
const store = new local_core_acp_store_js_1.LocalCoreAcpStore(userDataPath);
|
|
133
|
+
const oldThread = store.createThread('workspace-a', 'Old Lark thread');
|
|
134
|
+
const latestThread = store.createThread('workspace-a', 'Latest Lark thread');
|
|
135
|
+
const now = new Date().toISOString();
|
|
136
|
+
store.upsertPlatformThreadBinding({
|
|
137
|
+
workspace_id: 'workspace-a',
|
|
138
|
+
platform: 'lark',
|
|
139
|
+
chat_id: 'chat-1',
|
|
140
|
+
platform_user_id: 'user-1',
|
|
141
|
+
thread_id: oldThread.id,
|
|
142
|
+
last_platform_message_id: null,
|
|
143
|
+
created_at: now,
|
|
144
|
+
updated_at: now,
|
|
145
|
+
});
|
|
146
|
+
store.upsertPlatformThreadBinding({
|
|
147
|
+
workspace_id: 'workspace-a',
|
|
148
|
+
platform: 'lark',
|
|
149
|
+
chat_id: 'chat-1',
|
|
150
|
+
platform_user_id: 'user-1',
|
|
151
|
+
thread_id: latestThread.id,
|
|
152
|
+
last_platform_message_id: null,
|
|
153
|
+
created_at: now,
|
|
154
|
+
updated_at: now,
|
|
155
|
+
});
|
|
156
|
+
const job = store.createScheduledJob({
|
|
157
|
+
workspaceId: 'workspace-a',
|
|
158
|
+
platform: 'lark',
|
|
159
|
+
route: { type: 'channel.chat', channelId: 'chat-1', participantId: 'user-1', threadId: oldThread.id },
|
|
160
|
+
executionMode: 'same-thread',
|
|
161
|
+
triggerType: 'cron',
|
|
162
|
+
cronExpr: '30 18 * * *',
|
|
163
|
+
promptTemplate: 'ping',
|
|
164
|
+
description: 'bound lark task',
|
|
165
|
+
enabled: true,
|
|
166
|
+
});
|
|
167
|
+
let sentThreadId = '';
|
|
168
|
+
let deliveredRoute;
|
|
169
|
+
const adapter = new lark_schedule_adapter_js_1.LarkScheduleAdapter({
|
|
170
|
+
store,
|
|
171
|
+
getWorkspaceRouter: () => ({
|
|
172
|
+
getThread: async (threadId) => ({
|
|
173
|
+
id: threadId,
|
|
174
|
+
workspaceId: 'workspace-a',
|
|
175
|
+
title: 'Thread',
|
|
176
|
+
live: false,
|
|
177
|
+
updatedAt: now,
|
|
178
|
+
createdAt: now,
|
|
179
|
+
historyCount: 1,
|
|
180
|
+
excerpt: '',
|
|
181
|
+
bridgeSessionKey: '',
|
|
182
|
+
agentType: 'localcore-acp',
|
|
183
|
+
selectedKnowledgeBaseIds: [],
|
|
184
|
+
pendingPermissionRequest: null,
|
|
185
|
+
messages: [{ id: 'message-1', role: 'assistant', kind: 'final', content: 'pong', timestamp: now }],
|
|
186
|
+
}),
|
|
187
|
+
sendThreadMessage: async (threadId) => {
|
|
188
|
+
sentThreadId = threadId;
|
|
189
|
+
store.updateRun('run-1', threadId, 'completed');
|
|
190
|
+
return { runId: 'run-1' };
|
|
191
|
+
},
|
|
192
|
+
}),
|
|
193
|
+
getChannelRuntime: () => ({
|
|
194
|
+
muteThreadBridge: () => { },
|
|
195
|
+
unmuteThreadBridge: () => { },
|
|
196
|
+
sendScheduledMessage: async (_workspaceId, route) => {
|
|
197
|
+
deliveredRoute = route;
|
|
198
|
+
return 'platform-message-1';
|
|
199
|
+
},
|
|
200
|
+
}),
|
|
201
|
+
});
|
|
202
|
+
const result = await adapter.execute({ job, triggeredAt: now });
|
|
203
|
+
strict_1.default.equal(sentThreadId, latestThread.id);
|
|
204
|
+
strict_1.default.equal(result.threadId, latestThread.id);
|
|
205
|
+
strict_1.default.equal(result.platformMessageId, 'platform-message-1');
|
|
206
|
+
strict_1.default.deepEqual(deliveredRoute, {
|
|
207
|
+
type: 'channel.chat',
|
|
208
|
+
channelId: 'chat-1',
|
|
209
|
+
participantId: 'user-1',
|
|
210
|
+
});
|
|
211
|
+
store.close();
|
|
212
|
+
}
|
|
213
|
+
finally {
|
|
214
|
+
(0, node_fs_1.rmSync)(userDataPath, { recursive: true, force: true });
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
(0, node_test_1.default)('Lark scheduled execution supports instance-qualified platform keys', async () => {
|
|
218
|
+
const userDataPath = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'scheduler-lark-instance-'));
|
|
219
|
+
try {
|
|
220
|
+
const store = new local_core_acp_store_js_1.LocalCoreAcpStore(userDataPath);
|
|
221
|
+
const thread = store.createThread('workspace-a', 'Lark instance thread');
|
|
222
|
+
const now = new Date().toISOString();
|
|
223
|
+
store.upsertPlatformThreadBinding({
|
|
224
|
+
workspace_id: 'workspace-a',
|
|
225
|
+
platform: 'lark:lark-1',
|
|
226
|
+
chat_id: 'chat-1',
|
|
227
|
+
platform_user_id: 'user-1',
|
|
228
|
+
thread_id: thread.id,
|
|
229
|
+
last_platform_message_id: null,
|
|
230
|
+
created_at: now,
|
|
231
|
+
updated_at: now,
|
|
232
|
+
});
|
|
233
|
+
const job = store.createScheduledJob({
|
|
234
|
+
workspaceId: 'workspace-a',
|
|
235
|
+
platform: 'lark:lark-1',
|
|
236
|
+
route: { type: 'channel.chat', channelId: 'chat-1', participantId: 'user-1' },
|
|
237
|
+
executionMode: 'same-thread',
|
|
238
|
+
triggerType: 'cron',
|
|
239
|
+
cronExpr: '30 18 * * *',
|
|
240
|
+
promptTemplate: 'ping',
|
|
241
|
+
description: 'bound lark task',
|
|
242
|
+
enabled: true,
|
|
243
|
+
});
|
|
244
|
+
let deliveredRoute;
|
|
245
|
+
const adapter = new lark_schedule_adapter_js_1.LarkScheduleAdapter({
|
|
246
|
+
store,
|
|
247
|
+
getWorkspaceRouter: () => ({
|
|
248
|
+
getThread: async (threadId) => ({
|
|
249
|
+
id: threadId,
|
|
250
|
+
workspaceId: 'workspace-a',
|
|
251
|
+
title: 'Thread',
|
|
252
|
+
live: false,
|
|
253
|
+
updatedAt: now,
|
|
254
|
+
createdAt: now,
|
|
255
|
+
historyCount: 1,
|
|
256
|
+
excerpt: '',
|
|
257
|
+
bridgeSessionKey: '',
|
|
258
|
+
agentType: 'localcore-acp',
|
|
259
|
+
selectedKnowledgeBaseIds: [],
|
|
260
|
+
pendingPermissionRequest: null,
|
|
261
|
+
messages: [{ id: 'message-1', role: 'assistant', kind: 'final', content: 'pong', timestamp: now }],
|
|
262
|
+
}),
|
|
263
|
+
sendThreadMessage: async (threadId, _prompt, options) => {
|
|
264
|
+
strict_1.default.equal(threadId, thread.id);
|
|
265
|
+
strict_1.default.equal(options?.runtimeEnv?.LOCAL_AI_PLATFORM, 'lark');
|
|
266
|
+
strict_1.default.equal(options?.runtimeEnv?.LOCAL_AI_PLATFORM_INSTANCE_ID, 'lark-1');
|
|
267
|
+
strict_1.default.equal(options?.runtimeEnv?.LOCAL_AI_CHAT_ID, 'chat-1');
|
|
268
|
+
store.updateRun('run-1', threadId, 'completed');
|
|
269
|
+
return { runId: 'run-1' };
|
|
270
|
+
},
|
|
271
|
+
}),
|
|
272
|
+
getChannelRuntime: () => ({
|
|
273
|
+
muteThreadBridge: () => { },
|
|
274
|
+
unmuteThreadBridge: () => { },
|
|
275
|
+
sendScheduledMessage: async (_workspaceId, route) => {
|
|
276
|
+
deliveredRoute = route;
|
|
277
|
+
return 'platform-message-1';
|
|
278
|
+
},
|
|
279
|
+
}),
|
|
280
|
+
});
|
|
281
|
+
const result = await adapter.execute({ job, triggeredAt: now });
|
|
282
|
+
strict_1.default.equal(result.threadId, thread.id);
|
|
283
|
+
strict_1.default.equal(result.platformMessageId, 'platform-message-1');
|
|
284
|
+
strict_1.default.deepEqual(deliveredRoute, {
|
|
285
|
+
type: 'channel.chat',
|
|
286
|
+
channelId: 'chat-1',
|
|
287
|
+
instanceId: 'lark-1',
|
|
288
|
+
participantId: 'user-1',
|
|
289
|
+
});
|
|
290
|
+
store.close();
|
|
291
|
+
}
|
|
292
|
+
finally {
|
|
293
|
+
(0, node_fs_1.rmSync)(userDataPath, { recursive: true, force: true });
|
|
294
|
+
}
|
|
295
|
+
});
|
|
85
296
|
(0, node_test_1.default)('ACP runtime env includes the current workspace path for file returns', async () => {
|
|
86
297
|
const userDataPath = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), 'workspace-env-'));
|
|
87
298
|
try {
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const node_test_1 = __importDefault(require("node:test"));
|
|
7
7
|
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
8
8
|
const node_path_1 = require("node:path");
|
|
9
|
-
const content_js_1 = require("
|
|
10
|
-
const file_utils_js_1 = require("
|
|
9
|
+
const content_js_1 = require("../../services/local-ai-core/src/channel/shared/content.js");
|
|
10
|
+
const file_utils_js_1 = require("../../services/local-ai-core/src/channel/shared/file-utils.js");
|
|
11
11
|
(0, node_test_1.default)('channel thread message input stays plain text when there are no attachments', () => {
|
|
12
12
|
const input = (0, content_js_1.createChannelThreadMessageInput)('Alice: hello', [
|
|
13
13
|
{ type: 'text', text: 'hello' },
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const node_test_1 = __importDefault(require("node:test"));
|
|
7
7
|
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
8
|
-
const local_core_acp_content_js_1 = require("
|
|
8
|
+
const local_core_acp_content_js_1 = require("../../services/local-ai-core/src/acp/local-core-acp-content.js");
|
|
9
9
|
(0, node_test_1.default)('thread message input keeps inbound file content parts', () => {
|
|
10
10
|
const normalized = (0, local_core_acp_content_js_1.normalizeThreadMessageInput)({
|
|
11
11
|
displayText: '',
|
|
@@ -9,21 +9,21 @@ const node_fs_1 = require("node:fs");
|
|
|
9
9
|
const node_os_1 = require("node:os");
|
|
10
10
|
const node_path_1 = require("node:path");
|
|
11
11
|
const node_stream_1 = require("node:stream");
|
|
12
|
-
const local_core_acp_response_processor_js_1 = require("
|
|
13
|
-
const local_core_slash_commands_js_1 = require("
|
|
14
|
-
const scheduled_conversation_executor_js_1 = require("
|
|
15
|
-
const scheduler_run_lifecycle_js_1 = require("
|
|
16
|
-
const lark_execution_policies_js_1 = require("
|
|
17
|
-
const local_schedule_adapter_js_1 = require("
|
|
18
|
-
const local_core_weixin_gateway_js_1 = require("
|
|
19
|
-
const local_core_lark_gateway_js_1 = require("
|
|
20
|
-
const runtime_state_js_1 = require("
|
|
21
|
-
const local_core_acp_turn_coordinator_js_1 = require("
|
|
22
|
-
const local_core_acp_store_js_1 = require("
|
|
23
|
-
const local_core_acp_progress_js_1 = require("
|
|
24
|
-
const local_core_acp_permission_lifecycle_js_1 = require("
|
|
25
|
-
const workspace_acp_permissions_js_1 = require("
|
|
26
|
-
const server_routes_js_1 = require("
|
|
12
|
+
const local_core_acp_response_processor_js_1 = require("../../services/local-ai-core/src/acp/local-core-acp-response-processor.js");
|
|
13
|
+
const local_core_slash_commands_js_1 = require("../../services/local-ai-core/src/acp/local-core-slash-commands.js");
|
|
14
|
+
const scheduled_conversation_executor_js_1 = require("../../services/local-ai-core/src/scheduler/scheduled-conversation-executor.js");
|
|
15
|
+
const scheduler_run_lifecycle_js_1 = require("../../services/local-ai-core/src/scheduler/scheduler-run-lifecycle.js");
|
|
16
|
+
const lark_execution_policies_js_1 = require("../../services/local-ai-core/src/scheduler/lark-execution-policies.js");
|
|
17
|
+
const local_schedule_adapter_js_1 = require("../../services/local-ai-core/src/scheduler/local-schedule-adapter.js");
|
|
18
|
+
const local_core_weixin_gateway_js_1 = require("../../services/local-ai-core/src/channel/weixin/local-core-weixin-gateway.js");
|
|
19
|
+
const local_core_lark_gateway_js_1 = require("../../services/local-ai-core/src/channel/lark/local-core-lark-gateway.js");
|
|
20
|
+
const runtime_state_js_1 = require("../../services/local-ai-core/src/channel/lark/runtime-state.js");
|
|
21
|
+
const local_core_acp_turn_coordinator_js_1 = require("../../services/local-ai-core/src/acp/local-core-acp-turn-coordinator.js");
|
|
22
|
+
const local_core_acp_store_js_1 = require("../../services/local-ai-core/src/acp/local-core-acp-store.js");
|
|
23
|
+
const local_core_acp_progress_js_1 = require("../../services/local-ai-core/src/acp/local-core-acp-progress.js");
|
|
24
|
+
const local_core_acp_permission_lifecycle_js_1 = require("../../services/local-ai-core/src/acp/local-core-acp-permission-lifecycle.js");
|
|
25
|
+
const workspace_acp_permissions_js_1 = require("../../services/local-ai-core/src/acp/workspace-acp-permissions.js");
|
|
26
|
+
const server_routes_js_1 = require("../../services/local-ai-core/src/runtime/server-routes.js");
|
|
27
27
|
(0, node_test_1.default)('local core route parser separates runtime refresh and runtime detail routes', () => {
|
|
28
28
|
strict_1.default.deepEqual((0, server_routes_js_1.parseLocalAiCoreRoute)('GET', '/api/local/v1/runtimes'), { name: 'runtimes.list' });
|
|
29
29
|
strict_1.default.deepEqual((0, server_routes_js_1.parseLocalAiCoreRoute)('POST', '/api/local/v1/runtimes/refresh'), { name: 'runtimes.refresh' });
|
|
@@ -3512,11 +3512,12 @@ const server_routes_js_1 = require("../services/local-ai-core/src/runtime/server
|
|
|
3512
3512
|
});
|
|
3513
3513
|
(0, node_test_1.default)('scheduled conversation executor uses execution policy hooks around a thread run', async () => {
|
|
3514
3514
|
const calls = [];
|
|
3515
|
+
let runtimeEnv;
|
|
3515
3516
|
const job = {
|
|
3516
3517
|
id: 'job-1',
|
|
3517
3518
|
workspaceId: '知识库',
|
|
3518
|
-
platform: 'lark',
|
|
3519
|
-
route: { type: 'channel.chat', channelId: 'chat-1', participantId: 'user-1', threadId: 'thread-1' },
|
|
3519
|
+
platform: 'lark:lark-1',
|
|
3520
|
+
route: { type: 'channel.chat', channelId: 'chat-1', instanceId: 'lark-1', participantId: 'user-1', threadId: 'thread-1' },
|
|
3520
3521
|
executionMode: 'same-thread',
|
|
3521
3522
|
triggerType: 'cron',
|
|
3522
3523
|
cronExpr: '*/2 * * * *',
|
|
@@ -3533,6 +3534,7 @@ const server_routes_js_1 = require("../services/local-ai-core/src/runtime/server
|
|
|
3533
3534
|
},
|
|
3534
3535
|
workspaceRouter: {
|
|
3535
3536
|
sendThreadMessage: async (threadId, prompt, options) => {
|
|
3537
|
+
runtimeEnv = options?.runtimeEnv;
|
|
3536
3538
|
calls.push(`send:${threadId}:${prompt}:${options?.permissionMode || ''}`);
|
|
3537
3539
|
return { runId: 'run-1' };
|
|
3538
3540
|
},
|
|
@@ -3549,7 +3551,7 @@ const server_routes_js_1 = require("../services/local-ai-core/src/runtime/server
|
|
|
3549
3551
|
kind: 'thread',
|
|
3550
3552
|
threadId: 'thread-1',
|
|
3551
3553
|
workspaceId: '知识库',
|
|
3552
|
-
platform: 'lark',
|
|
3554
|
+
platform: 'lark:lark-1',
|
|
3553
3555
|
route: job.route,
|
|
3554
3556
|
}),
|
|
3555
3557
|
beforeExecute: (target) => {
|
|
@@ -3564,6 +3566,13 @@ const server_routes_js_1 = require("../services/local-ai-core/src/runtime/server
|
|
|
3564
3566
|
'send:thread-1:ping:bypassPermissions',
|
|
3565
3567
|
'after:thread-1',
|
|
3566
3568
|
]);
|
|
3569
|
+
strict_1.default.deepEqual(runtimeEnv, {
|
|
3570
|
+
LOCAL_AI_PLATFORM: 'lark',
|
|
3571
|
+
LOCAL_AI_ROUTE_TYPE: 'channel.chat',
|
|
3572
|
+
LOCAL_AI_PLATFORM_INSTANCE_ID: 'lark-1',
|
|
3573
|
+
LOCAL_AI_CHAT_ID: 'chat-1',
|
|
3574
|
+
LOCAL_AI_PLATFORM_USER_ID: 'user-1',
|
|
3575
|
+
});
|
|
3567
3576
|
strict_1.default.equal(result.replyText, 'done');
|
|
3568
3577
|
});
|
|
3569
3578
|
(0, node_test_1.default)('local scheduler adapter runs a workspace thread without channel delivery', async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kafca/agentdock",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.34",
|
|
4
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"main": "dist-electron/electron/main.js",
|
|
6
7
|
"bin": {
|
|
@@ -31,7 +32,7 @@
|
|
|
31
32
|
"build:renderer": "vite build",
|
|
32
33
|
"build:electron": "node scripts/write-electron-package.mjs && tsc -p tsconfig.electron.json",
|
|
33
34
|
"build:core": "pnpm build:electron",
|
|
34
|
-
"test": "pnpm build:renderer && pnpm build:electron && node --test dist-electron/electron/*.test.js dist-electron/packages/knowledge-api/test/*.test.js dist-electron/src/pages/Threads/thread-chat-permission.test.js",
|
|
35
|
+
"test": "pnpm build:renderer && pnpm build:electron && node --test dist-electron/tests/electron/*.test.js dist-electron/tests/contracts/*.test.js dist-electron/tests/integration/*.test.js dist-electron/packages/knowledge-api/test/*.test.js dist-electron/src/pages/Threads/thread-chat-permission.test.js",
|
|
35
36
|
"e2e:smoke": "pnpm build && node scripts/e2e-smoke.mjs",
|
|
36
37
|
"dist:mac": "pnpm build && electron-builder --mac dmg zip --arm64",
|
|
37
38
|
"dist:win": "pnpm build && electron-builder --win nsis zip --x64",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{z as t}from"./index-BBaYsVjU.js";const e=()=>t.get("/projects"),r=o=>t.get(`/projects/${o}`);export{r as g,e as l};
|
|
File without changes
|
|
File without changes
|