@kafca/agentdock 0.1.52 → 0.1.53

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 (49) hide show
  1. package/dist/renderer/assets/{Badge-H0XWc7vp.js → Badge-pBiMqECO.js} +1 -1
  2. package/dist/renderer/assets/{Chat-bR-LSg9D.js → Chat-pQVBr82B.js} +1 -1
  3. package/dist/renderer/assets/{ChatMarkdown-ZnK1NWdh.js → ChatMarkdown-SCxRo6-e.js} +1 -1
  4. package/dist/renderer/assets/{Config-DdhdELsW.js → Config-DRtyF20X.js} +1 -1
  5. package/dist/renderer/assets/{CronList-gyQuGhGg.js → CronList-BA5hVrYp.js} +1 -1
  6. package/dist/renderer/assets/{Dashboard-DaLRkrf-.js → Dashboard-p3yI0Fck.js} +2 -2
  7. package/dist/renderer/assets/{EmptyState-Ci2bjyET.js → EmptyState-Dgh25c2x.js} +1 -1
  8. package/dist/renderer/assets/{KnowledgeDetail-D5dqZC5f.js → KnowledgeDetail-CuC3Cjg1.js} +1 -1
  9. package/dist/renderer/assets/{KnowledgeHome-DIhbMvM8.js → KnowledgeHome-CH4GqtEZ.js} +1 -1
  10. package/dist/renderer/assets/{Logs-DIF8ymaI.js → Logs-BQrm2cq-.js} +1 -1
  11. package/dist/renderer/assets/{Modal-O77lsvJu.js → Modal-DfZsUS3Q.js} +1 -1
  12. package/dist/renderer/assets/{MonitorList-CJBrqytq.js → MonitorList-CDWGIf1Q.js} +1 -1
  13. package/dist/renderer/assets/{Page-CodHoUwH.js → Page-CpmZ134Z.js} +1 -1
  14. package/dist/renderer/assets/{ProjectDetail-Bt4Dj60f.js → ProjectDetail-B-Kwqodz.js} +1 -1
  15. package/dist/renderer/assets/{ProjectList-CZTkHOyM.js → ProjectList-DtNT6dv-.js} +1 -1
  16. package/dist/renderer/assets/{Select-DGCo_gYI.js → Select--_s_a1uj.js} +1 -1
  17. package/dist/renderer/assets/{SessionChat-CHm7HyvI.js → SessionChat-BHfKpufe.js} +1 -1
  18. package/dist/renderer/assets/{SessionList-Df2wQinW.js → SessionList-B0kQz-Ms.js} +1 -1
  19. package/dist/renderer/assets/{ThreadChat-Iomr0Qx9.js → ThreadChat-CRb6Z42k.js} +1 -1
  20. package/dist/renderer/assets/{Workspace-r8lHxaBj.js → Workspace-j-O-14yC.js} +1 -1
  21. package/dist/renderer/assets/{arrow-left-r950YY17.js → arrow-left-DnhnG-Tj.js} +1 -1
  22. package/dist/renderer/assets/{book-open-BslYrNTy.js → book-open-Dgp3xcUz.js} +1 -1
  23. package/dist/renderer/assets/{bot-BVfQh_eb.js → bot-BollztzX.js} +1 -1
  24. package/dist/renderer/assets/{check-BSAurnOI.js → check-BHj-iSsR.js} +1 -1
  25. package/dist/renderer/assets/{chevron-down-B9G43XLT.js → chevron-down-CeXCREMg.js} +1 -1
  26. package/dist/renderer/assets/{circle-CBHOs0lN.js → circle-B3eGQ-H3.js} +1 -1
  27. package/dist/renderer/assets/{desktop-CXcNupTW.js → desktop-B5cYIqJH.js} +1 -1
  28. package/dist/renderer/assets/{funnel-UDX21Ev4.js → funnel-BkgiQrZC.js} +1 -1
  29. package/dist/renderer/assets/{heart-CzmLZP5g.js → heart-C-H_BPOT.js} +1 -1
  30. package/dist/renderer/assets/{index-DeTNhSbD.js → index-C97cND_H.js} +1 -1
  31. package/dist/renderer/assets/{index-C581X81v.js → index-CYaol0bB.js} +2 -2
  32. package/dist/renderer/assets/{pencil-BFLsShcu.js → pencil-DBHjVmSd.js} +1 -1
  33. package/dist/renderer/assets/{play-YFpAnQ9r.js → play-Cu9TIeSO.js} +1 -1
  34. package/dist/renderer/assets/{plus-D8uIIQB9.js → plus-PaUGBkMK.js} +1 -1
  35. package/dist/renderer/assets/projects-BmW4zbEE.js +1 -0
  36. package/dist/renderer/assets/{save-Cgx9qe4w.js → save-dm5NifZE.js} +1 -1
  37. package/dist/renderer/assets/{search-CxscB_CP.js → search-Cq8cwrp6.js} +1 -1
  38. package/dist/renderer/assets/{server-KW8nGvbV.js → server-DwiMsKFq.js} +1 -1
  39. package/dist/renderer/assets/{session-utils-oB-uPAPg.js → session-utils-CD2tqK35.js} +1 -1
  40. package/dist/renderer/assets/{sessions-CefxFisH.js → sessions-quZ-oFVW.js} +1 -1
  41. package/dist/renderer/assets/{shield-check-Bl-k8F5V.js → shield-check-B9UsjycW.js} +1 -1
  42. package/dist/renderer/assets/{trash-2-DvmnFiu7.js → trash-2-CitZGPQS.js} +1 -1
  43. package/dist/renderer/assets/{user-ZZO21GY4.js → user-BgVotGiF.js} +1 -1
  44. package/dist/renderer/assets/{wifi-off-1dHHA2Em.js → wifi-off-CMgxdgfX.js} +1 -1
  45. package/dist/renderer/index.html +1 -1
  46. package/dist-electron/services/local-ai-core/src/scheduler/channel-execution-policy.js +11 -2
  47. package/dist-electron/tests/integration/local-core-refactor.test.js +79 -0
  48. package/package.json +1 -1
  49. 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-CYaol0bB.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-CYaol0bB.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-CYaol0bB.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-CYaol0bB.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-CYaol0bB.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-CYaol0bB.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-CYaol0bB.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-CYaol0bB.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-CYaol0bB.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-CYaol0bB.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-CYaol0bB.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-CYaol0bB.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-CYaol0bB.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-CYaol0bB.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]">
@@ -53,9 +53,9 @@ class SideThreadChannelExecutionPolicy {
53
53
  title,
54
54
  ...(this.config.legacySideThreadTitles?.(job) || []),
55
55
  ]);
56
+ const preferredAgent = normalizeAgentType(this.config.preferredAgentType?.(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.threadMatchesPreferredAgent(thread, preferredAgent));
59
59
  const threadId = existing?.id
60
60
  || (await this.options.workspaceRouter.createThread(job.workspaceId, title, preferredAgent || undefined)).id;
61
61
  return {
@@ -78,4 +78,13 @@ class SideThreadChannelExecutionPolicy {
78
78
  await this.bridgeSession?.close();
79
79
  this.bridgeSession = undefined;
80
80
  }
81
+ threadMatchesPreferredAgent(thread, preferredAgent) {
82
+ if (!preferredAgent) {
83
+ return true;
84
+ }
85
+ return normalizeAgentType(thread.agentType) === preferredAgent;
86
+ }
87
+ }
88
+ function normalizeAgentType(value) {
89
+ return String(value || '').trim().toLowerCase();
81
90
  }
@@ -898,6 +898,85 @@ const thread_slash_command_dispatcher_js_1 = require("../../services/local-ai-co
898
898
  agentType: 'claudecode',
899
899
  });
900
900
  });
901
+ (0, node_test_1.default)('lark side-thread execution policy skips reusable threads with a different preferred agent', async () => {
902
+ const job = {
903
+ id: 'job-1',
904
+ workspaceId: '知识库',
905
+ platform: 'lark',
906
+ route: { type: 'channel.chat', channelId: 'chat-1', participantId: 'user-1', threadId: 'thread-origin' },
907
+ executionMode: 'side-thread',
908
+ triggerType: 'cron',
909
+ cronExpr: '*/2 * * * *',
910
+ promptTemplate: 'ping',
911
+ description: 'two-minute ping',
912
+ enabled: true,
913
+ concurrencyPolicy: 'skip_if_running',
914
+ createdAt: '2026-04-22T06:00:00.000Z',
915
+ updatedAt: '2026-04-22T06:00:00.000Z',
916
+ };
917
+ const createThreadCalls = [];
918
+ const policy = (0, lark_execution_policies_js_1.createLarkExecutionPolicy)(job, {
919
+ store: {},
920
+ workspaceRouter: {
921
+ getThreadSessionKey: (threadId) => `session:${threadId}`,
922
+ listThreads: async () => [
923
+ { id: 'thread-old-codex', title: '[Scheduled:Lark] two-minute ping', agentType: 'codex' },
924
+ ],
925
+ createThread: async (workspaceId, title, agentType) => {
926
+ createThreadCalls.push({ workspaceId, title: title || '', agentType });
927
+ return { id: 'thread-new-claudecode' };
928
+ },
929
+ },
930
+ getChannelRuntime: () => ({
931
+ registerScheduledThreadBridge: () => () => { },
932
+ }),
933
+ }, async () => 'thread-origin', () => 'claudecode');
934
+ const target = await policy.resolveTarget(job);
935
+ strict_1.default.equal(target.threadId, 'thread-new-claudecode');
936
+ strict_1.default.equal(createThreadCalls.length, 1);
937
+ strict_1.default.deepEqual(createThreadCalls[0], {
938
+ workspaceId: '知识库',
939
+ title: '[Scheduled:Lark] two-minute ping',
940
+ agentType: 'claudecode',
941
+ });
942
+ });
943
+ (0, node_test_1.default)('lark side-thread execution policy reuses a thread with the preferred agent', async () => {
944
+ const job = {
945
+ id: 'job-1',
946
+ workspaceId: '知识库',
947
+ platform: 'lark',
948
+ route: { type: 'channel.chat', channelId: 'chat-1', participantId: 'user-1', threadId: 'thread-origin' },
949
+ executionMode: 'side-thread',
950
+ triggerType: 'cron',
951
+ cronExpr: '*/2 * * * *',
952
+ promptTemplate: 'ping',
953
+ description: 'two-minute ping',
954
+ enabled: true,
955
+ concurrencyPolicy: 'skip_if_running',
956
+ createdAt: '2026-04-22T06:00:00.000Z',
957
+ updatedAt: '2026-04-22T06:00:00.000Z',
958
+ };
959
+ let created = false;
960
+ const policy = (0, lark_execution_policies_js_1.createLarkExecutionPolicy)(job, {
961
+ store: {},
962
+ workspaceRouter: {
963
+ getThreadSessionKey: (threadId) => `session:${threadId}`,
964
+ listThreads: async () => [
965
+ { id: 'thread-matching-claudecode', title: '[Scheduled:Lark] two-minute ping', agentType: 'claudecode' },
966
+ ],
967
+ createThread: async () => {
968
+ created = true;
969
+ return { id: 'thread-new' };
970
+ },
971
+ },
972
+ getChannelRuntime: () => ({
973
+ registerScheduledThreadBridge: () => () => { },
974
+ }),
975
+ }, async () => 'thread-origin', () => 'claudecode');
976
+ const target = await policy.resolveTarget(job);
977
+ strict_1.default.equal(target.threadId, 'thread-matching-claudecode');
978
+ strict_1.default.equal(created, false);
979
+ });
901
980
  (0, node_test_1.default)('lark side-thread execution policy falls back to workspace default when no preferred agent is set', async () => {
902
981
  const job = {
903
982
  id: 'job-1',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kafca/agentdock",
3
- "version": "0.1.52",
3
+ "version": "0.1.53",
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};