@kafca/agentdock 0.1.52 → 0.1.54

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.
Files changed (50) hide show
  1. package/dist/renderer/assets/{Badge-H0XWc7vp.js → Badge-Rs12sArE.js} +1 -1
  2. package/dist/renderer/assets/{Chat-bR-LSg9D.js → Chat-C9KfsjuN.js} +1 -1
  3. package/dist/renderer/assets/{ChatMarkdown-ZnK1NWdh.js → ChatMarkdown-C3m7Mxpl.js} +1 -1
  4. package/dist/renderer/assets/{Config-DdhdELsW.js → Config-BhIq2lQa.js} +1 -1
  5. package/dist/renderer/assets/{CronList-gyQuGhGg.js → CronList-CenDzorW.js} +1 -1
  6. package/dist/renderer/assets/{Dashboard-DaLRkrf-.js → Dashboard-BmeP5ocP.js} +2 -2
  7. package/dist/renderer/assets/{EmptyState-Ci2bjyET.js → EmptyState-BGONB4VS.js} +1 -1
  8. package/dist/renderer/assets/{KnowledgeDetail-D5dqZC5f.js → KnowledgeDetail-Ba3PuI7k.js} +1 -1
  9. package/dist/renderer/assets/{KnowledgeHome-DIhbMvM8.js → KnowledgeHome-DkKXM7Bd.js} +1 -1
  10. package/dist/renderer/assets/{Logs-DIF8ymaI.js → Logs-DTITWY-y.js} +1 -1
  11. package/dist/renderer/assets/{Modal-O77lsvJu.js → Modal-BvFew60s.js} +1 -1
  12. package/dist/renderer/assets/{MonitorList-CJBrqytq.js → MonitorList-DruqInIG.js} +1 -1
  13. package/dist/renderer/assets/{Page-CodHoUwH.js → Page-CLjmm8c6.js} +1 -1
  14. package/dist/renderer/assets/{ProjectDetail-Bt4Dj60f.js → ProjectDetail-BCFaJig0.js} +1 -1
  15. package/dist/renderer/assets/{ProjectList-CZTkHOyM.js → ProjectList-Btg-mgwA.js} +1 -1
  16. package/dist/renderer/assets/{Select-DGCo_gYI.js → Select-CAwaG7ol.js} +1 -1
  17. package/dist/renderer/assets/{SessionChat-CHm7HyvI.js → SessionChat-CHPrm0Zs.js} +1 -1
  18. package/dist/renderer/assets/{SessionList-Df2wQinW.js → SessionList-0aGulton.js} +1 -1
  19. package/dist/renderer/assets/{ThreadChat-Iomr0Qx9.js → ThreadChat-BkSc0hKN.js} +1 -1
  20. package/dist/renderer/assets/{Workspace-r8lHxaBj.js → Workspace-DXJ3BGia.js} +1 -1
  21. package/dist/renderer/assets/{arrow-left-r950YY17.js → arrow-left-Co19QKUc.js} +1 -1
  22. package/dist/renderer/assets/{book-open-BslYrNTy.js → book-open-CtlUo2yw.js} +1 -1
  23. package/dist/renderer/assets/{bot-BVfQh_eb.js → bot-D-3jCeDr.js} +1 -1
  24. package/dist/renderer/assets/{check-BSAurnOI.js → check-Cf5Y5H-1.js} +1 -1
  25. package/dist/renderer/assets/{chevron-down-B9G43XLT.js → chevron-down-D1tfS-tx.js} +1 -1
  26. package/dist/renderer/assets/{circle-CBHOs0lN.js → circle-DJOCyk2U.js} +1 -1
  27. package/dist/renderer/assets/{desktop-CXcNupTW.js → desktop-CmZMgSXn.js} +1 -1
  28. package/dist/renderer/assets/{funnel-UDX21Ev4.js → funnel-ZRCc1DCy.js} +1 -1
  29. package/dist/renderer/assets/{heart-CzmLZP5g.js → heart-BuJEvv8x.js} +1 -1
  30. package/dist/renderer/assets/{index-DeTNhSbD.js → index-0gZsyozU.js} +1 -1
  31. package/dist/renderer/assets/{index-C581X81v.js → index-CDWUe2Sw.js} +2 -2
  32. package/dist/renderer/assets/{pencil-BFLsShcu.js → pencil-sISh8tMs.js} +1 -1
  33. package/dist/renderer/assets/{play-YFpAnQ9r.js → play-CccQpZit.js} +1 -1
  34. package/dist/renderer/assets/{plus-D8uIIQB9.js → plus-hxAkcfQ0.js} +1 -1
  35. package/dist/renderer/assets/projects-CjdfXQ1l.js +1 -0
  36. package/dist/renderer/assets/{save-Cgx9qe4w.js → save-By5b-_0Q.js} +1 -1
  37. package/dist/renderer/assets/{search-CxscB_CP.js → search-CLzr87Rw.js} +1 -1
  38. package/dist/renderer/assets/{server-KW8nGvbV.js → server-CubB1eW5.js} +1 -1
  39. package/dist/renderer/assets/{session-utils-oB-uPAPg.js → session-utils-Cz45af_C.js} +1 -1
  40. package/dist/renderer/assets/{sessions-CefxFisH.js → sessions-C8np5fRp.js} +1 -1
  41. package/dist/renderer/assets/{shield-check-Bl-k8F5V.js → shield-check-CemAc1Ry.js} +1 -1
  42. package/dist/renderer/assets/{trash-2-DvmnFiu7.js → trash-2-DFKhii8D.js} +1 -1
  43. package/dist/renderer/assets/{user-ZZO21GY4.js → user-CaR8Rru_.js} +1 -1
  44. package/dist/renderer/assets/{wifi-off-1dHHA2Em.js → wifi-off-C8miJu8i.js} +1 -1
  45. package/dist/renderer/index.html +1 -1
  46. package/dist-electron/services/local-ai-core/src/runtime/agent-runtime-detector.js +1 -1
  47. package/dist-electron/services/local-ai-core/src/scheduler/channel-execution-policy.js +16 -3
  48. package/dist-electron/tests/integration/local-core-refactor.test.js +130 -2
  49. package/package.json +1 -1
  50. package/dist/renderer/assets/projects-D2hAJzY0.js +0 -1
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-C581X81v.js";/**
1
+ import{c as a}from"./index-CDWUe2Sw.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-C581X81v.js";/**
1
+ import{c as o}from"./index-CDWUe2Sw.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-C581X81v.js";/**
1
+ import{c as e}from"./index-CDWUe2Sw.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{D as t}from"./index-CDWUe2Sw.js";const e=()=>t.get("/projects"),r=o=>t.get(`/projects/${o}`);export{r as g,e as l};
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-C581X81v.js";/**
1
+ import{c as a}from"./index-CDWUe2Sw.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-C581X81v.js";/**
1
+ import{c}from"./index-CDWUe2Sw.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-C581X81v.js";/**
1
+ import{c as e}from"./index-CDWUe2Sw.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./index-C581X81v.js";/**
1
+ import{c as o}from"./index-CDWUe2Sw.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{D as o}from"./index-C581X81v.js";const i=s=>o.get(`/projects/${s}/sessions`),c=(s,e,t)=>o.get(`/projects/${s}/sessions/${e}`,{history_limit:String(t)}),r=(s,e,t)=>o.patch(`/projects/${s}/sessions/${e}`,t),a=(s,e)=>o.delete(`/projects/${s}/sessions/${e}`),p=(s,e)=>o.post(`/projects/${s}/sessions/switch`,e),$=(s,e)=>o.post(`/projects/${s}/send`,e);export{$ as a,a as d,c as g,i as l,r,p as s};
1
+ import{D as o}from"./index-CDWUe2Sw.js";const i=s=>o.get(`/projects/${s}/sessions`),c=(s,e,t)=>o.get(`/projects/${s}/sessions/${e}`,{history_limit:String(t)}),r=(s,e,t)=>o.patch(`/projects/${s}/sessions/${e}`,t),a=(s,e)=>o.delete(`/projects/${s}/sessions/${e}`),p=(s,e)=>o.post(`/projects/${s}/sessions/switch`,e),$=(s,e)=>o.post(`/projects/${s}/send`,e);export{$ as a,a as d,c as g,i as l,r,p as s};
@@ -1,4 +1,4 @@
1
- import{c}from"./index-C581X81v.js";/**
1
+ import{c}from"./index-CDWUe2Sw.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-C581X81v.js";/**
1
+ import{c as e}from"./index-CDWUe2Sw.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-C581X81v.js";/**
1
+ import{c}from"./index-CDWUe2Sw.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-C581X81v.js";/**
1
+ import{c as a}from"./index-CDWUe2Sw.js";/**
2
2
  * @license lucide-react v0.487.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="./favicon.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>AgentDock</title>
8
- <script type="module" crossorigin src="./assets/index-C581X81v.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-CDWUe2Sw.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="./assets/index-CjCuR6DI.css">
10
10
  </head>
11
11
  <body class="bg-[#f5f5f7] dark:bg-[#151516]">
@@ -12,7 +12,7 @@ function detectInstalledAgentRuntimes(options = {}) {
12
12
  const env = options.env || process.env;
13
13
  const configuredCommands = collectConfiguredAgentCommands(options.config);
14
14
  const detectedAt = (options.now || new Date()).toISOString();
15
- const versionTimeoutMs = options.versionTimeoutMs ?? 1500;
15
+ const versionTimeoutMs = options.versionTimeoutMs ?? 3000;
16
16
  const agentTypes = options.runtimeId
17
17
  ? desktop_js_1.DESKTOP_AGENT_TYPE_OPTIONS.filter((agentType) => agentType === options.runtimeId)
18
18
  : desktop_js_1.DESKTOP_AGENT_TYPE_OPTIONS;
@@ -53,11 +53,11 @@ class SideThreadChannelExecutionPolicy {
53
53
  title,
54
54
  ...(this.config.legacySideThreadTitles?.(job) || []),
55
55
  ]);
56
+ const targetAgent = await this.resolveTargetAgent(job);
56
57
  const existing = (await this.options.workspaceRouter.listThreads(job.workspaceId))
57
- .find((thread) => reusableTitles.has(thread.title));
58
- const preferredAgent = this.config.preferredAgentType?.(job) || '';
58
+ .find((thread) => reusableTitles.has(thread.title) && this.threadMatchesTargetAgent(thread, targetAgent));
59
59
  const threadId = existing?.id
60
- || (await this.options.workspaceRouter.createThread(job.workspaceId, title, preferredAgent || undefined)).id;
60
+ || (await this.options.workspaceRouter.createThread(job.workspaceId, title, targetAgent || undefined)).id;
61
61
  return {
62
62
  kind: `${this.config.platformBase}:side-thread`,
63
63
  threadId,
@@ -78,4 +78,17 @@ class SideThreadChannelExecutionPolicy {
78
78
  await this.bridgeSession?.close();
79
79
  this.bridgeSession = undefined;
80
80
  }
81
+ async resolveTargetAgent(job) {
82
+ const preferredAgent = normalizeAgentType(this.config.preferredAgentType?.(job));
83
+ if (preferredAgent) {
84
+ return preferredAgent;
85
+ }
86
+ return normalizeAgentType(await this.options.workspaceRouter.getWorkspaceDefaultAgentType(job.workspaceId));
87
+ }
88
+ threadMatchesTargetAgent(thread, targetAgent) {
89
+ return normalizeAgentType(thread.agentType) === targetAgent;
90
+ }
91
+ }
92
+ function normalizeAgentType(value) {
93
+ return String(value || '').trim().toLowerCase();
81
94
  }
@@ -824,7 +824,8 @@ const thread_slash_command_dispatcher_js_1 = require("../../services/local-ai-co
824
824
  store: {},
825
825
  workspaceRouter: {
826
826
  getThreadSessionKey: (threadId) => `session:${threadId}`,
827
- listThreads: async () => [{ id: 'thread-scheduled', title: '[Scheduled] two-minute ping' }],
827
+ getWorkspaceDefaultAgentType: async () => 'claudecode',
828
+ listThreads: async () => [{ id: 'thread-scheduled', title: '[Scheduled] two-minute ping', agentType: 'claudecode' }],
828
829
  createThread: async () => ({ id: 'thread-new' }),
829
830
  },
830
831
  getChannelRuntime: () => ({
@@ -898,6 +899,85 @@ const thread_slash_command_dispatcher_js_1 = require("../../services/local-ai-co
898
899
  agentType: 'claudecode',
899
900
  });
900
901
  });
902
+ (0, node_test_1.default)('lark side-thread execution policy skips reusable threads with a different preferred agent', async () => {
903
+ const job = {
904
+ id: 'job-1',
905
+ workspaceId: '知识库',
906
+ platform: 'lark',
907
+ route: { type: 'channel.chat', channelId: 'chat-1', participantId: 'user-1', threadId: 'thread-origin' },
908
+ executionMode: 'side-thread',
909
+ triggerType: 'cron',
910
+ cronExpr: '*/2 * * * *',
911
+ promptTemplate: 'ping',
912
+ description: 'two-minute ping',
913
+ enabled: true,
914
+ concurrencyPolicy: 'skip_if_running',
915
+ createdAt: '2026-04-22T06:00:00.000Z',
916
+ updatedAt: '2026-04-22T06:00:00.000Z',
917
+ };
918
+ const createThreadCalls = [];
919
+ const policy = (0, lark_execution_policies_js_1.createLarkExecutionPolicy)(job, {
920
+ store: {},
921
+ workspaceRouter: {
922
+ getThreadSessionKey: (threadId) => `session:${threadId}`,
923
+ listThreads: async () => [
924
+ { id: 'thread-old-codex', title: '[Scheduled:Lark] two-minute ping', agentType: 'codex' },
925
+ ],
926
+ createThread: async (workspaceId, title, agentType) => {
927
+ createThreadCalls.push({ workspaceId, title: title || '', agentType });
928
+ return { id: 'thread-new-claudecode' };
929
+ },
930
+ },
931
+ getChannelRuntime: () => ({
932
+ registerScheduledThreadBridge: () => () => { },
933
+ }),
934
+ }, async () => 'thread-origin', () => 'claudecode');
935
+ const target = await policy.resolveTarget(job);
936
+ strict_1.default.equal(target.threadId, 'thread-new-claudecode');
937
+ strict_1.default.equal(createThreadCalls.length, 1);
938
+ strict_1.default.deepEqual(createThreadCalls[0], {
939
+ workspaceId: '知识库',
940
+ title: '[Scheduled:Lark] two-minute ping',
941
+ agentType: 'claudecode',
942
+ });
943
+ });
944
+ (0, node_test_1.default)('lark side-thread execution policy reuses a thread with the preferred agent', async () => {
945
+ const job = {
946
+ id: 'job-1',
947
+ workspaceId: '知识库',
948
+ platform: 'lark',
949
+ route: { type: 'channel.chat', channelId: 'chat-1', participantId: 'user-1', threadId: 'thread-origin' },
950
+ executionMode: 'side-thread',
951
+ triggerType: 'cron',
952
+ cronExpr: '*/2 * * * *',
953
+ promptTemplate: 'ping',
954
+ description: 'two-minute ping',
955
+ enabled: true,
956
+ concurrencyPolicy: 'skip_if_running',
957
+ createdAt: '2026-04-22T06:00:00.000Z',
958
+ updatedAt: '2026-04-22T06:00:00.000Z',
959
+ };
960
+ let created = false;
961
+ const policy = (0, lark_execution_policies_js_1.createLarkExecutionPolicy)(job, {
962
+ store: {},
963
+ workspaceRouter: {
964
+ getThreadSessionKey: (threadId) => `session:${threadId}`,
965
+ listThreads: async () => [
966
+ { id: 'thread-matching-claudecode', title: '[Scheduled:Lark] two-minute ping', agentType: 'claudecode' },
967
+ ],
968
+ createThread: async () => {
969
+ created = true;
970
+ return { id: 'thread-new' };
971
+ },
972
+ },
973
+ getChannelRuntime: () => ({
974
+ registerScheduledThreadBridge: () => () => { },
975
+ }),
976
+ }, async () => 'thread-origin', () => 'claudecode');
977
+ const target = await policy.resolveTarget(job);
978
+ strict_1.default.equal(target.threadId, 'thread-matching-claudecode');
979
+ strict_1.default.equal(created, false);
980
+ });
901
981
  (0, node_test_1.default)('lark side-thread execution policy falls back to workspace default when no preferred agent is set', async () => {
902
982
  const job = {
903
983
  id: 'job-1',
@@ -919,6 +999,7 @@ const thread_slash_command_dispatcher_js_1 = require("../../services/local-ai-co
919
999
  store: {},
920
1000
  workspaceRouter: {
921
1001
  getThreadSessionKey: (threadId) => `session:${threadId}`,
1002
+ getWorkspaceDefaultAgentType: async () => 'pi',
922
1003
  listThreads: async () => [],
923
1004
  createThread: async (workspaceId, title, agentType) => {
924
1005
  createThreadCalls.push({ workspaceId, title: title || '', agentType });
@@ -932,7 +1013,54 @@ const thread_slash_command_dispatcher_js_1 = require("../../services/local-ai-co
932
1013
  const target = await policy.resolveTarget(job);
933
1014
  strict_1.default.equal(target.threadId, 'thread-new');
934
1015
  strict_1.default.equal(createThreadCalls.length, 1);
935
- strict_1.default.equal(createThreadCalls[0].agentType, undefined);
1016
+ strict_1.default.deepEqual(createThreadCalls[0], {
1017
+ workspaceId: '知识库',
1018
+ title: '[Scheduled:Lark] two-minute ping',
1019
+ agentType: 'pi',
1020
+ });
1021
+ });
1022
+ (0, node_test_1.default)('lark side-thread execution policy skips reusable threads with a different workspace default agent', async () => {
1023
+ const job = {
1024
+ id: 'job-1',
1025
+ workspaceId: '知识库',
1026
+ platform: 'lark',
1027
+ route: { type: 'channel.chat', channelId: 'chat-1', participantId: 'user-1', threadId: 'thread-origin' },
1028
+ executionMode: 'side-thread',
1029
+ triggerType: 'cron',
1030
+ cronExpr: '*/2 * * * *',
1031
+ promptTemplate: 'ping',
1032
+ description: 'two-minute ping',
1033
+ enabled: true,
1034
+ concurrencyPolicy: 'skip_if_running',
1035
+ createdAt: '2026-04-22T06:00:00.000Z',
1036
+ updatedAt: '2026-04-22T06:00:00.000Z',
1037
+ };
1038
+ const createThreadCalls = [];
1039
+ const policy = (0, lark_execution_policies_js_1.createLarkExecutionPolicy)(job, {
1040
+ store: {},
1041
+ workspaceRouter: {
1042
+ getThreadSessionKey: (threadId) => `session:${threadId}`,
1043
+ getWorkspaceDefaultAgentType: async () => 'claudecode',
1044
+ listThreads: async () => [
1045
+ { id: 'thread-old-codex', title: '[Scheduled:Lark] two-minute ping', agentType: 'codex' },
1046
+ ],
1047
+ createThread: async (workspaceId, title, agentType) => {
1048
+ createThreadCalls.push({ workspaceId, title: title || '', agentType });
1049
+ return { id: 'thread-new-claudecode' };
1050
+ },
1051
+ },
1052
+ getChannelRuntime: () => ({
1053
+ registerScheduledThreadBridge: () => () => { },
1054
+ }),
1055
+ }, async () => 'thread-origin', () => '');
1056
+ const target = await policy.resolveTarget(job);
1057
+ strict_1.default.equal(target.threadId, 'thread-new-claudecode');
1058
+ strict_1.default.equal(createThreadCalls.length, 1);
1059
+ strict_1.default.deepEqual(createThreadCalls[0], {
1060
+ workspaceId: '知识库',
1061
+ title: '[Scheduled:Lark] two-minute ping',
1062
+ agentType: 'claudecode',
1063
+ });
936
1064
  });
937
1065
  (0, node_test_1.default)('lark same-thread execution policy keeps the original thread target', async () => {
938
1066
  const job = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kafca/agentdock",
3
- "version": "0.1.52",
3
+ "version": "0.1.54",
4
4
  "license": "PolyForm-Noncommercial-1.0.0",
5
5
  "type": "module",
6
6
  "main": "dist-electron/electron/main.js",
@@ -1 +0,0 @@
1
- import{D as t}from"./index-C581X81v.js";const e=()=>t.get("/projects"),r=o=>t.get(`/projects/${o}`);export{r as g,e as l};