@kafca/agentdock 0.1.57 → 0.1.61
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/renderer/assets/{Badge-CDTbmw1h.js → Badge-BLI4LHse.js} +1 -1
- package/dist/renderer/assets/{Card-DayUo35w.js → Card-DJeLDdL3.js} +1 -1
- package/dist/renderer/assets/{Config-ByGMQuzR.js → Config-D1awc81A.js} +1 -1
- package/dist/renderer/assets/{CronList-XqHdVlgu.js → CronList-CupZoNwW.js} +1 -1
- package/dist/renderer/assets/{Dashboard-CZj-oANw.js → Dashboard-nLZnOtcs.js} +2 -2
- package/dist/renderer/assets/{EmptyState-EFMkOjZO.js → EmptyState-CkI1RwPX.js} +1 -1
- package/dist/renderer/assets/{HighlightedMarkdown-DyvF3DHK.js → HighlightedMarkdown-BUhDlhgW.js} +1 -1
- package/dist/renderer/assets/{Input-DxoWVc9d.js → Input-DHYrn-Ne.js} +1 -1
- package/dist/renderer/assets/{KnowledgeDetail-CbUb2tG7.js → KnowledgeDetail-Bij-Xo90.js} +1 -1
- package/dist/renderer/assets/{KnowledgeHome-BWV1gz4f.js → KnowledgeHome-DmPZ2IlI.js} +1 -1
- package/dist/renderer/assets/{Logs-DqnanQTc.js → Logs-ISY99heA.js} +1 -1
- package/dist/renderer/assets/{Modal-yY7TzR0x.js → Modal-DAQfz0ot.js} +1 -1
- package/dist/renderer/assets/{MonitorList-CIjGQkFs.js → MonitorList-BlX82rXF.js} +1 -1
- package/dist/renderer/assets/{Page-vwHNUdoj.js → Page-Dw43UYDT.js} +1 -1
- package/dist/renderer/assets/{Select-CmbK36pN.js → Select-DzmN5OGQ.js} +1 -1
- package/dist/renderer/assets/{ThreadChat-4OceMgM4.js → ThreadChat-B5CWqqMK.js} +3 -3
- package/dist/renderer/assets/{Workspace-DplPJOjJ.js → Workspace-C5g9LBj9.js} +1 -1
- package/dist/renderer/assets/{arrow-left-C8HfBt2K.js → arrow-left-BLXh56Ip.js} +1 -1
- package/dist/renderer/assets/{book-open-BCdZWncQ.js → book-open-DhPGbc-7.js} +1 -1
- package/dist/renderer/assets/{channels-hgO3cAIx.js → channels-DfQrmuYO.js} +1 -1
- package/dist/renderer/assets/{chevron-down-BPk77tqY.js → chevron-down-CEFtpPDc.js} +1 -1
- package/dist/renderer/assets/{index-BlA4xPdd.js → index-CYhDUAR_.js} +1 -1
- package/dist/renderer/assets/{index-wYpjqVqC.js → index-Dd00oqgY.js} +2 -2
- package/dist/renderer/assets/{knowledge-7pl06KuH.js → knowledge-uHRQ80sR.js} +1 -1
- package/dist/renderer/assets/{pencil-CB1SWZ9A.js → pencil-BD2Y31YC.js} +1 -1
- package/dist/renderer/assets/{play-BvsoXUrM.js → play-DBJ8wsSy.js} +1 -1
- package/dist/renderer/assets/{plus-CokBDnaL.js → plus-DDcldp_c.js} +1 -1
- package/dist/renderer/assets/{save-D-w4kATO.js → save-CMW_cZI9.js} +1 -1
- package/dist/renderer/assets/{search-Cnsn6i4Q.js → search-BM-0CvJr.js} +1 -1
- package/dist/renderer/assets/{shield-check-Cjja2Gh6.js → shield-check-DaMB0FKG.js} +1 -1
- package/dist/renderer/assets/{threads-BCm6j4eI.js → threads-DZgt9tWj.js} +1 -1
- package/dist/renderer/assets/{trash-2-CIxz9qYY.js → trash-2-DTXVbC5y.js} +1 -1
- package/dist/renderer/index.html +1 -1
- package/dist-electron/services/local-ai-core/src/automation/automation-conversation-executor.js +6 -47
- package/dist-electron/services/local-ai-core/src/automation/automation-monitor-service.js +2 -5
- package/dist-electron/services/local-ai-core/src/channel/lark/local-core-lark-gateway.js +6 -53
- package/dist-electron/services/local-ai-core/src/channel/lark/outbound-transport.js +25 -37
- package/dist-electron/services/local-ai-core/src/channel/lark/runtime-state.js +5 -20
- package/dist-electron/services/local-ai-core/src/channel/shared/base-channel-gateway.js +37 -0
- package/dist-electron/services/local-ai-core/src/channel/shared/bridge-event-helpers.js +23 -0
- package/dist-electron/services/local-ai-core/src/channel/shared/channel-keys.js +6 -0
- package/dist-electron/services/local-ai-core/src/channel/weixin/inbound-poller.js +2 -2
- package/dist-electron/services/local-ai-core/src/channel/weixin/local-core-weixin-gateway.js +6 -44
- package/dist-electron/services/local-ai-core/src/channel/weixin/runtime-state.js +4 -11
- package/dist-electron/services/local-ai-core/src/channel/weixin/text-utils.js +0 -8
- package/dist-electron/services/local-ai-core/src/cli/lac.js +3 -5
- package/dist-electron/services/local-ai-core/src/kernel/local-core-errors.js +8 -0
- package/dist-electron/services/local-ai-core/src/sandbox/opensandbox-client.js +3 -2
- package/dist-electron/services/local-ai-core/src/scheduler/base-channel-schedule-adapter.js +77 -0
- package/dist-electron/services/local-ai-core/src/scheduler/lark-schedule-adapter.js +13 -79
- package/dist-electron/services/local-ai-core/src/scheduler/local-schedule-adapter.js +2 -10
- package/dist-electron/services/local-ai-core/src/scheduler/run-polling.js +19 -0
- package/dist-electron/services/local-ai-core/src/scheduler/scheduled-conversation-executor.js +3 -37
- package/dist-electron/services/local-ai-core/src/scheduler/scheduled-job-route.js +20 -0
- package/dist-electron/services/local-ai-core/src/scheduler/scheduler-service.js +15 -28
- package/dist-electron/services/local-ai-core/src/scheduler/thread-resolution.js +12 -0
- package/dist-electron/services/local-ai-core/src/scheduler/weixin-schedule-adapter.js +13 -79
- package/dist-electron/tests/integration/local-core-refactor.test.js +15 -8
- package/package.json +2 -4
- package/dist-electron/services/local-ai-core/src/scheduler/lark-execution-policies.js +0 -13
- package/dist-electron/services/local-ai-core/src/scheduler/weixin-execution-policies.js +0 -13
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.threadExists = threadExists;
|
|
4
|
+
async function threadExists(router, threadId) {
|
|
5
|
+
try {
|
|
6
|
+
await router.getThread(threadId);
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -1,87 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WeixinScheduleAdapter = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
executor;
|
|
4
|
+
const channel_execution_policy_js_1 = require("./channel-execution-policy.js");
|
|
5
|
+
const base_channel_schedule_adapter_js_1 = require("./base-channel-schedule-adapter.js");
|
|
6
|
+
class WeixinScheduleAdapter extends base_channel_schedule_adapter_js_1.BaseChannelScheduleAdapter {
|
|
7
|
+
platformBase = 'weixin';
|
|
8
|
+
supportedRouteTypes = ['channel.chat', 'weixin_chat'];
|
|
10
9
|
deliveryTargets = ['weixin'];
|
|
11
|
-
|
|
12
|
-
this.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
createPolicy(job, options, resolveSameThread, preferredAgentType) {
|
|
11
|
+
const label = this.platformBase.charAt(0).toUpperCase() + this.platformBase.slice(1);
|
|
12
|
+
return (0, channel_execution_policy_js_1.createChannelExecutionPolicy)(job, options, {
|
|
13
|
+
platformBase: this.platformBase,
|
|
14
|
+
resolveSameThread,
|
|
15
|
+
sideThreadTitle: (nextJob) => `[Scheduled:${label}] ${nextJob.description || nextJob.id}`,
|
|
16
|
+
legacySideThreadTitles: (nextJob) => [`[Scheduled] ${nextJob.description || nextJob.id}`],
|
|
17
|
+
preferredAgentType,
|
|
16
18
|
});
|
|
17
19
|
}
|
|
18
|
-
supports(job) {
|
|
19
|
-
return (0, scheduled_job_route_js_1.platformMatches)(job.platform, 'weixin') && (job.route.type === 'channel.chat' || job.route.type === 'weixin_chat');
|
|
20
|
-
}
|
|
21
|
-
async execute(context) {
|
|
22
|
-
const { job } = context;
|
|
23
|
-
const executionPolicy = (0, weixin_execution_policies_js_1.createWeixinExecutionPolicy)(job, {
|
|
24
|
-
store: this.options.store,
|
|
25
|
-
workspaceRouter: this.options.getWorkspaceRouter(),
|
|
26
|
-
getChannelRuntime: this.options.getChannelRuntime,
|
|
27
|
-
}, (nextJob) => this.resolveThread(nextJob), (nextJob) => this.preferredAgentFor(nextJob));
|
|
28
|
-
const execution = await this.executor.execute(job, job.promptTemplate, executionPolicy);
|
|
29
|
-
return {
|
|
30
|
-
threadId: execution.threadId,
|
|
31
|
-
runId: execution.runId,
|
|
32
|
-
replyText: execution.replyText,
|
|
33
|
-
deliveryMode: 'bridge-stream',
|
|
34
|
-
deliveryStatus: 'succeeded',
|
|
35
|
-
lastBridgeEventAt: new Date().toISOString(),
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
async resolveThread(job) {
|
|
39
|
-
const workspaceRouter = this.options.getWorkspaceRouter();
|
|
40
|
-
const route = job.route;
|
|
41
|
-
const channelId = route.channelId;
|
|
42
|
-
const participantId = route.participantId || '';
|
|
43
|
-
const binding = this.options.store.getPlatformThreadBinding(job.workspaceId, channelId, participantId, job.platform);
|
|
44
|
-
if (binding?.thread_id && await this.threadExists(binding.thread_id)) {
|
|
45
|
-
return binding.thread_id;
|
|
46
|
-
}
|
|
47
|
-
if (route.threadId && await this.threadExists(route.threadId)) {
|
|
48
|
-
return route.threadId;
|
|
49
|
-
}
|
|
50
|
-
const thread = await workspaceRouter.createThread(job.workspaceId, job.description || `Scheduled ${job.platform} task`);
|
|
51
|
-
const now = new Date().toISOString();
|
|
52
|
-
this.options.store.upsertPlatformThreadBinding({
|
|
53
|
-
workspace_id: job.workspaceId,
|
|
54
|
-
platform: 'weixin',
|
|
55
|
-
chat_id: channelId,
|
|
56
|
-
platform_user_id: participantId,
|
|
57
|
-
thread_id: thread.id,
|
|
58
|
-
last_platform_message_id: null,
|
|
59
|
-
created_at: now,
|
|
60
|
-
updated_at: now,
|
|
61
|
-
});
|
|
62
|
-
const authorized = this.options.store.getAuthorizedUser(job.workspaceId, participantId, job.platform);
|
|
63
|
-
if (authorized) {
|
|
64
|
-
this.options.store.updateAuthorizedUserThread(job.workspaceId, participantId, thread.id, job.platform);
|
|
65
|
-
}
|
|
66
|
-
return thread.id;
|
|
67
|
-
}
|
|
68
|
-
async threadExists(threadId) {
|
|
69
|
-
try {
|
|
70
|
-
await this.options.getWorkspaceRouter().getThread(threadId);
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
preferredAgentFor(job) {
|
|
78
|
-
const route = job.route;
|
|
79
|
-
const channelId = route.channelId;
|
|
80
|
-
if (!channelId)
|
|
81
|
-
return '';
|
|
82
|
-
const participantId = route.participantId || '';
|
|
83
|
-
const binding = this.options.store.getPlatformThreadBinding(job.workspaceId, channelId, participantId, job.platform);
|
|
84
|
-
return binding?.preferred_agent_type || '';
|
|
85
|
-
}
|
|
86
20
|
}
|
|
87
21
|
exports.WeixinScheduleAdapter = WeixinScheduleAdapter;
|
|
@@ -12,7 +12,14 @@ const local_core_acp_response_processor_js_1 = require("../../services/local-ai-
|
|
|
12
12
|
const local_core_slash_commands_js_1 = require("../../services/local-ai-core/src/acp/local-core-slash-commands.js");
|
|
13
13
|
const scheduled_conversation_executor_js_1 = require("../../services/local-ai-core/src/scheduler/scheduled-conversation-executor.js");
|
|
14
14
|
const scheduler_run_lifecycle_js_1 = require("../../services/local-ai-core/src/scheduler/scheduler-run-lifecycle.js");
|
|
15
|
-
const
|
|
15
|
+
const channel_execution_policy_js_1 = require("../../services/local-ai-core/src/scheduler/channel-execution-policy.js");
|
|
16
|
+
const createLarkExecutionPolicy = (job, options, resolveSameThread, preferredAgentType) => (0, channel_execution_policy_js_1.createChannelExecutionPolicy)(job, options, {
|
|
17
|
+
platformBase: 'lark',
|
|
18
|
+
resolveSameThread,
|
|
19
|
+
sideThreadTitle: (nextJob) => `[Scheduled:Lark] ${nextJob.description || nextJob.id}`,
|
|
20
|
+
legacySideThreadTitles: (nextJob) => [`[Scheduled] ${nextJob.description || nextJob.id}`],
|
|
21
|
+
preferredAgentType,
|
|
22
|
+
});
|
|
16
23
|
const local_schedule_adapter_js_1 = require("../../services/local-ai-core/src/scheduler/local-schedule-adapter.js");
|
|
17
24
|
const cards_js_1 = require("../../services/local-ai-core/src/channel/lark/cards.js");
|
|
18
25
|
const session_command_runtime_js_1 = require("../../services/local-ai-core/src/channel/shared/session-command-runtime.js");
|
|
@@ -820,7 +827,7 @@ const thread_slash_command_dispatcher_js_1 = require("../../services/local-ai-co
|
|
|
820
827
|
let registeredBridge;
|
|
821
828
|
const bridgeEvents = [];
|
|
822
829
|
let unregisteredBridge = false;
|
|
823
|
-
const policy =
|
|
830
|
+
const policy = createLarkExecutionPolicy(job, {
|
|
824
831
|
store: {},
|
|
825
832
|
workspaceRouter: {
|
|
826
833
|
getThreadSessionKey: (threadId) => `session:${threadId}`,
|
|
@@ -876,7 +883,7 @@ const thread_slash_command_dispatcher_js_1 = require("../../services/local-ai-co
|
|
|
876
883
|
updatedAt: '2026-04-22T06:00:00.000Z',
|
|
877
884
|
};
|
|
878
885
|
const createThreadCalls = [];
|
|
879
|
-
const policy =
|
|
886
|
+
const policy = createLarkExecutionPolicy(job, {
|
|
880
887
|
store: {},
|
|
881
888
|
workspaceRouter: {
|
|
882
889
|
getThreadSessionKey: (threadId) => `session:${threadId}`,
|
|
@@ -916,7 +923,7 @@ const thread_slash_command_dispatcher_js_1 = require("../../services/local-ai-co
|
|
|
916
923
|
updatedAt: '2026-04-22T06:00:00.000Z',
|
|
917
924
|
};
|
|
918
925
|
const createThreadCalls = [];
|
|
919
|
-
const policy =
|
|
926
|
+
const policy = createLarkExecutionPolicy(job, {
|
|
920
927
|
store: {},
|
|
921
928
|
workspaceRouter: {
|
|
922
929
|
getThreadSessionKey: (threadId) => `session:${threadId}`,
|
|
@@ -958,7 +965,7 @@ const thread_slash_command_dispatcher_js_1 = require("../../services/local-ai-co
|
|
|
958
965
|
updatedAt: '2026-04-22T06:00:00.000Z',
|
|
959
966
|
};
|
|
960
967
|
let created = false;
|
|
961
|
-
const policy =
|
|
968
|
+
const policy = createLarkExecutionPolicy(job, {
|
|
962
969
|
store: {},
|
|
963
970
|
workspaceRouter: {
|
|
964
971
|
getThreadSessionKey: (threadId) => `session:${threadId}`,
|
|
@@ -995,7 +1002,7 @@ const thread_slash_command_dispatcher_js_1 = require("../../services/local-ai-co
|
|
|
995
1002
|
updatedAt: '2026-04-22T06:00:00.000Z',
|
|
996
1003
|
};
|
|
997
1004
|
const createThreadCalls = [];
|
|
998
|
-
const policy =
|
|
1005
|
+
const policy = createLarkExecutionPolicy(job, {
|
|
999
1006
|
store: {},
|
|
1000
1007
|
workspaceRouter: {
|
|
1001
1008
|
getThreadSessionKey: (threadId) => `session:${threadId}`,
|
|
@@ -1036,7 +1043,7 @@ const thread_slash_command_dispatcher_js_1 = require("../../services/local-ai-co
|
|
|
1036
1043
|
updatedAt: '2026-04-22T06:00:00.000Z',
|
|
1037
1044
|
};
|
|
1038
1045
|
const createThreadCalls = [];
|
|
1039
|
-
const policy =
|
|
1046
|
+
const policy = createLarkExecutionPolicy(job, {
|
|
1040
1047
|
store: {},
|
|
1041
1048
|
workspaceRouter: {
|
|
1042
1049
|
getThreadSessionKey: (threadId) => `session:${threadId}`,
|
|
@@ -1079,7 +1086,7 @@ const thread_slash_command_dispatcher_js_1 = require("../../services/local-ai-co
|
|
|
1079
1086
|
updatedAt: '2026-04-22T06:00:00.000Z',
|
|
1080
1087
|
};
|
|
1081
1088
|
let registeredBridge;
|
|
1082
|
-
const policy =
|
|
1089
|
+
const policy = createLarkExecutionPolicy(job, {
|
|
1083
1090
|
store: {},
|
|
1084
1091
|
workspaceRouter: {
|
|
1085
1092
|
getThreadSessionKey: (threadId) => `session:${threadId}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kafca/agentdock",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.61",
|
|
4
4
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist-electron/electron/main.js",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
|
+
"prepack": "node scripts/strip-workspace-deps.mjs",
|
|
26
27
|
"dev": "node scripts/dev.mjs",
|
|
27
28
|
"dev:web": "pnpm exec vite --host 127.0.0.1 --port 5173",
|
|
28
29
|
"dev:core": "pnpm build:electron && node scripts/launch-core.mjs",
|
|
@@ -46,9 +47,6 @@
|
|
|
46
47
|
},
|
|
47
48
|
"dependencies": {
|
|
48
49
|
"@agentclientprotocol/claude-agent-acp": "^0.30.0",
|
|
49
|
-
"@cc/core-sdk": "workspace:*",
|
|
50
|
-
"@cc/plugin-sdk": "workspace:*",
|
|
51
|
-
"@cc/superai-contracts": "workspace:*",
|
|
52
50
|
"@iarna/toml": "^2.2.5",
|
|
53
51
|
"@larksuiteoapi/node-sdk": "^1.58.0",
|
|
54
52
|
"@mariozechner/pi-coding-agent": "^0.72.1",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createLarkExecutionPolicy = createLarkExecutionPolicy;
|
|
4
|
-
const channel_execution_policy_js_1 = require("./channel-execution-policy.js");
|
|
5
|
-
function createLarkExecutionPolicy(job, options, resolveSameThread, preferredAgentType) {
|
|
6
|
-
return (0, channel_execution_policy_js_1.createChannelExecutionPolicy)(job, options, {
|
|
7
|
-
platformBase: 'lark',
|
|
8
|
-
resolveSameThread,
|
|
9
|
-
sideThreadTitle: (nextJob) => `[Scheduled:Lark] ${nextJob.description || nextJob.id}`,
|
|
10
|
-
legacySideThreadTitles: (nextJob) => [`[Scheduled] ${nextJob.description || nextJob.id}`],
|
|
11
|
-
preferredAgentType,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createWeixinExecutionPolicy = createWeixinExecutionPolicy;
|
|
4
|
-
const channel_execution_policy_js_1 = require("./channel-execution-policy.js");
|
|
5
|
-
function createWeixinExecutionPolicy(job, options, resolveSameThread, preferredAgentType) {
|
|
6
|
-
return (0, channel_execution_policy_js_1.createChannelExecutionPolicy)(job, options, {
|
|
7
|
-
platformBase: 'weixin',
|
|
8
|
-
resolveSameThread,
|
|
9
|
-
sideThreadTitle: (nextJob) => `[Scheduled:Weixin] ${nextJob.description || nextJob.id}`,
|
|
10
|
-
legacySideThreadTitles: (nextJob) => [`[Scheduled] ${nextJob.description || nextJob.id}`],
|
|
11
|
-
preferredAgentType,
|
|
12
|
-
});
|
|
13
|
-
}
|