chatlab-cli 0.36.0 → 0.36.1
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.md +7 -7
- package/dist/{chat-command-SXW67RF7.mjs → chat-command-XPJ43KSW.mjs} +10 -10
- package/dist/chat-command-XPJ43KSW.mjs.map +1 -0
- package/dist/{chunk-BSGLH6G3.mjs → chunk-2JPFBIAG.mjs} +144 -79
- package/dist/chunk-2JPFBIAG.mjs.map +1 -0
- package/dist/{chunk-VDWI4A4U.mjs → chunk-5MJO4AJB.mjs} +2 -2
- package/dist/{chunk-GVW3BDGZ.mjs → chunk-67HNPYZJ.mjs} +3 -3
- package/dist/{chunk-UNIKQFI5.mjs → chunk-6QP47LID.mjs} +2 -2
- package/dist/{chunk-4YPNYQSP.mjs → chunk-FJOGBUXU.mjs} +390 -96
- package/dist/chunk-FJOGBUXU.mjs.map +1 -0
- package/dist/{chunk-XDF6PMVZ.mjs → chunk-JOVL7OTW.mjs} +2 -2
- package/dist/{chunk-CNEWMCGX.mjs → chunk-L7TIIVAY.mjs} +57 -57
- package/dist/chunk-L7TIIVAY.mjs.map +1 -0
- package/dist/{chunk-U2NXHIJK.mjs → chunk-NFTCEJBJ.mjs} +3 -3
- package/dist/{chunk-AAGDVTP2.mjs → chunk-NQHZPSW2.mjs} +2 -2
- package/dist/{chunk-OWOEWZIC.mjs → chunk-Q3NEL2KK.mjs} +82 -28
- package/dist/chunk-Q3NEL2KK.mjs.map +1 -0
- package/dist/{chunk-LZGOIRLV.mjs → chunk-R73XMAB2.mjs} +9 -5
- package/dist/chunk-R73XMAB2.mjs.map +1 -0
- package/dist/{chunk-JHON5FN7.mjs → chunk-X2QBH24F.mjs} +8 -3
- package/dist/chunk-X2QBH24F.mjs.map +1 -0
- package/dist/cli.mjs +9 -9
- package/dist/contacts-worker.mjs +2 -2
- package/dist/global-insight-worker.mjs +1 -1
- package/dist/{http-LVOGJFDL.mjs → http-5RVY5J5U.mjs} +12 -12
- package/dist/{import-7OU57ZHM.mjs → import-ILTWVHKU.mjs} +7 -7
- package/dist/index.mjs +12 -12
- package/dist/{mcp-CUKHTTII.mjs → mcp-Y2YXOFB4.mjs} +8 -8
- package/dist/people-relationships-worker.mjs +2 -2
- package/dist/semantic-index-worker.mjs +1 -1
- package/dist/{service-KZTHBDQ5.mjs → service-ZAHXRSFD.mjs} +6 -6
- package/dist/service-ZAHXRSFD.mjs.map +1 -0
- package/dist/{src-LORFXAUE.mjs → src-OV5ZNE3Z.mjs} +10 -6
- package/dist/{stream-import-7YUWIAD6.mjs → stream-import-XOUM3Z5W.mjs} +7 -7
- package/dist/{undici-MU5I3L6Q.mjs → undici-UGXDRJLV.mjs} +193 -193
- package/dist/undici-UGXDRJLV.mjs.map +1 -0
- package/dist/{update-checker-3N7HQEP2.mjs → update-checker-UL2FBLXH.mjs} +3 -5
- package/dist/{update-checker-3N7HQEP2.mjs.map → update-checker-UL2FBLXH.mjs.map} +1 -1
- package/dist/{worker-runtime-GQ5SY7E3.mjs → worker-runtime-JNGURHDM.mjs} +5 -5
- package/dist-cli-web/assets/AISettingsTab-vvjijrc5.js +1 -0
- package/dist-cli-web/assets/AboutTab-CxI8zJNz.js +1 -0
- package/dist-cli-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang-w0hHEodr.js +110 -0
- package/dist-cli-web/assets/{Alert-DJzXKcec.js → Alert-_MYcI_E2.js} +1 -1
- package/dist-cli-web/assets/ApiSettingsTab-CK7U6dVA.js +2 -0
- package/dist-cli-web/assets/BatchManageTab-1WnEqqpB.js +1 -0
- package/dist-cli-web/assets/{BufferResource-DY3P-dGs.js → BufferResource-i64DlwQT.js} +1 -1
- package/dist-cli-web/assets/{CanvasRenderer-As2MJTWZ.js → CanvasRenderer-B76mEt9A.js} +1 -1
- package/dist-cli-web/assets/ChatRecordDrawer-Bp6OSCrz.js +1 -0
- package/dist-cli-web/assets/{ChatRecordWorkspace-CVDPBmcl.js → ChatRecordWorkspace-CyfPIlIy.js} +1 -1
- package/dist-cli-web/assets/{Checkbox-4F1WAuVF.js → Checkbox-Ci7IeRw1.js} +1 -1
- package/dist-cli-web/assets/DataDirCleanupNotice-Dh63pOLt.js +1 -0
- package/dist-cli-web/assets/DatePicker.vue_vue_type_script_setup_true_lang-DqNBNa1D.js +1 -0
- package/dist-cli-web/assets/{DebugToolsPanel-BLU6SY8a.js → DebugToolsPanel-CbNsD9co.js} +1 -1
- package/dist-cli-web/assets/EChart.vue_vue_type_script_setup_true_lang-YeqmodwE.js +1 -0
- package/dist-cli-web/assets/EChartBar.vue_vue_type_script_setup_true_lang-C3pZmq0v.js +1 -0
- package/dist-cli-web/assets/{EChartLine.vue_vue_type_script_setup_true_lang-BYhukELX.js → EChartLine.vue_vue_type_script_setup_true_lang-Co6olfwv.js} +1 -1
- package/dist-cli-web/assets/{EChartWordcloud-C16xh7Tx.js → EChartWordcloud-rDusZwSq.js} +1 -1
- package/dist-cli-web/assets/{Filter-BEtPORqF.js → Filter-yxkeHO78.js} +1 -1
- package/dist-cli-web/assets/GlobalTaskBar-BlZ-fFiq.js +1 -0
- package/dist-cli-web/assets/GroupRelationshipGalaxyView-BXQBX0zJ.js +1 -0
- package/dist-cli-web/assets/{Label-Dgl3ghzT.js → Label-CFAZFBQX.js} +1 -1
- package/dist-cli-web/assets/LoadingState.vue_vue_type_script_setup_true_lang-CwgpqtMZ.js +1 -0
- package/dist-cli-web/assets/MessageExportModal-DU71grc7.js +1 -0
- package/dist-cli-web/assets/{PageHeader-CL9AFfvl.js → PageHeader-BDPf4NuI.js} +1 -1
- package/dist-cli-web/assets/{PageTabs.vue_vue_type_script_setup_true_lang-C22kOxIK.js → PageTabs.vue_vue_type_script_setup_true_lang-_j82asQU.js} +1 -1
- package/dist-cli-web/assets/{RelationshipGalaxyCanvas-BnkcrIpk.js → RelationshipGalaxyCanvas-BODk18aA.js} +14 -14
- package/dist-cli-web/assets/RelationshipGalaxyThreeCanvas-BJyuRiC-.js +4168 -0
- package/dist-cli-web/assets/RelationshipGalaxyThreeCanvas-CCasBcBQ.css +1 -0
- package/dist-cli-web/assets/{RenderTargetSystem-CPwnC2X3.js → RenderTargetSystem-CVMvAUSv.js} +1 -1
- package/dist-cli-web/assets/RovingFocusItem-DC_06OmN.js +1 -0
- package/dist-cli-web/assets/{ScreenCaptureModal-ByKxzNQe.js → ScreenCaptureModal-DrBFDOtC.js} +1 -1
- package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-C-Zj2biH.js +1 -0
- package/dist-cli-web/assets/{Select-jVtfc_xc.js → Select-DLK2LYhO.js} +1 -1
- package/dist-cli-web/assets/SettingsModal-BFkxzo0Y.css +1 -0
- package/dist-cli-web/assets/SettingsModal-DqaR4Dx5.js +2 -0
- package/dist-cli-web/assets/{StorageTab-QdcDqA6Q.js → StorageTab-B0ebN0f8.js} +1 -1
- package/dist-cli-web/assets/{Switch-DYHM64k9.js → Switch-CokhQWxm.js} +1 -1
- package/dist-cli-web/assets/{Tabs-B6Nzq2NQ.js → Tabs-D1UiZNaZ.js} +1 -1
- package/dist-cli-web/assets/Tabs-N3Q-Mpqi.js +1 -0
- package/dist-cli-web/assets/{ThemeCard.vue_vue_type_script_setup_true_lang-Bsq7gpC0.js → ThemeCard.vue_vue_type_script_setup_true_lang-OT-I0mbU.js} +1 -1
- package/dist-cli-web/assets/TimeSelect.vue_vue_type_script_setup_true_lang-Ccunouyf.js +1 -0
- package/dist-cli-web/assets/{VisuallyHiddenInput-IQpmK9yR.js → VisuallyHiddenInput-OAJEt_Y5.js} +1 -1
- package/dist-cli-web/assets/{WebGLRenderer-8JHbnkTc.js → WebGLRenderer-DuUeftYD.js} +1 -1
- package/dist-cli-web/assets/{WebGPURenderer-CLWfB4CC.js → WebGPURenderer-DoWQxiWZ.js} +1 -1
- package/dist-cli-web/assets/aiChat-CdADfRnU.js +8 -0
- package/dist-cli-web/assets/{browserAll-Cin6ghNg.js → browserAll-Cb-mtR2y.js} +1 -1
- package/dist-cli-web/assets/{cli-web-D7IBc3AX.js → cli-web-BHQCZLLg.js} +1 -1
- package/dist-cli-web/assets/{fetch-B7kuohCt.js → fetch-AvsnJLWJ.js} +1 -1
- package/dist-cli-web/assets/{fetch-BR71C0K9.js → fetch-B-6tyYWu.js} +1 -1
- package/dist-cli-web/assets/{fetch-OnnCjzee.js → fetch-B4PYy5JS.js} +1 -1
- package/dist-cli-web/assets/{fetch-_CN1EVMt.js → fetch-BbcFaCRB.js} +1 -1
- package/dist-cli-web/assets/{fetch-C8tTTsCm.js → fetch-BkA_so1e.js} +1 -1
- package/dist-cli-web/assets/{fetch-2QEQPA9q.js → fetch-BzXuAaT3.js} +1 -1
- package/dist-cli-web/assets/fetch-CW2fKvGp.js +1 -0
- package/dist-cli-web/assets/{fetch-CuUeyk0N.js → fetch-DEub4tOo.js} +1 -1
- package/dist-cli-web/assets/{fetch-1NiXh-_B.js → fetch-DLTlYnDB.js} +1 -1
- package/dist-cli-web/assets/{fetch-B2agy1hy.js → fetch-Qs38Hx1V.js} +1 -1
- package/dist-cli-web/assets/{fetch-Bk-7vxHV.js → fetch-sYDJ-Zs8.js} +1 -1
- package/dist-cli-web/assets/{fetch-DPRDSI39.js → fetch-ul8-uQIb.js} +1 -1
- package/dist-cli-web/assets/host-B6SQ6OGo.js +1 -0
- package/dist-cli-web/assets/host-DYIkQqvY.js +1 -0
- package/dist-cli-web/assets/{index-BCEk6ZpL.js → index--IEkRjKe.js} +10 -10
- package/dist-cli-web/assets/index-9iaY_EWG.js +1 -0
- package/dist-cli-web/assets/index-BnaLj2dx.css +1 -0
- package/dist-cli-web/assets/index-C7omDgiJ.js +2 -0
- package/dist-cli-web/assets/index-CHsM84U1.js +2 -0
- package/dist-cli-web/assets/index-CL8u01Pf.js +137 -0
- package/dist-cli-web/assets/{index-BIHFuCJK.js → index-CShh95fU.js} +1 -1
- package/dist-cli-web/assets/index-C_OS8Y8W.js +1 -0
- package/dist-cli-web/assets/{index-Colc58j-.js → index-D64XYYts.js} +1 -1
- package/dist-cli-web/assets/index-DrCc8p_I.css +1 -0
- package/dist-cli-web/assets/index-Dz_ddyZS.css +1 -0
- package/dist-cli-web/assets/index-UpTe1KzQ.js +1 -0
- package/dist-cli-web/assets/index-a8Hw6eD8.js +1 -0
- package/dist-cli-web/assets/index-jwjzZNKm.js +1 -0
- package/dist-cli-web/assets/index-pkxlF8Ee.js +1 -0
- package/dist-cli-web/assets/index-sWxuTsa7.js +36 -0
- package/dist-cli-web/assets/{people-page-header-DNPjaSt4.js → people-page-header-0jvXFFnh.js} +1 -1
- package/dist-cli-web/assets/{prompt-BgywZQ_g.js → prompt-BPYj29Vq.js} +1 -1
- package/dist-cli-web/assets/{semantic-index-config-builder-bji_UxYE.js → semantic-index-config-builder-vO37z355.js} +1 -1
- package/dist-cli-web/assets/service-CVoA9yNf.js +1 -0
- package/dist-cli-web/assets/{service-DpU9fa-l.js → service-D29Vftq9.js} +1 -1
- package/dist-cli-web/assets/service-DMysyLCa.js +1 -0
- package/dist-cli-web/assets/{useFormControl-De24E2zT.js → useFormControl-DVawP2DO.js} +1 -1
- package/dist-cli-web/assets/useTable-Bv3R_Hux.js +1 -0
- package/dist-cli-web/assets/useToast-BA0EwImD.js +1 -0
- package/dist-cli-web/assets/{vendor-echarts-DfAMQxdr.js → vendor-echarts-hTLhTs52.js} +5 -5
- package/dist-cli-web/assets/{vendor-echarts-wordcloud-BsaEJTPY.js → vendor-echarts-wordcloud-B8CF_NgP.js} +1 -1
- package/dist-cli-web/assets/{vendor-zrender-PFmZe1EY.js → vendor-zrender-D8psf1AA.js} +2 -2
- package/dist-cli-web/assets/{webworkerAll-BRnv6GvJ.js → webworkerAll-ZPE_yGnC.js} +1 -1
- package/dist-cli-web/index.html +2 -2
- package/package.json +4 -4
- package/dist/chat-command-SXW67RF7.mjs.map +0 -1
- package/dist/chunk-4YPNYQSP.mjs.map +0 -1
- package/dist/chunk-BSGLH6G3.mjs.map +0 -1
- package/dist/chunk-CNEWMCGX.mjs.map +0 -1
- package/dist/chunk-JHON5FN7.mjs.map +0 -1
- package/dist/chunk-LZGOIRLV.mjs.map +0 -1
- package/dist/chunk-OWOEWZIC.mjs.map +0 -1
- package/dist/service-KZTHBDQ5.mjs.map +0 -1
- package/dist/undici-MU5I3L6Q.mjs.map +0 -1
- package/dist-cli-web/assets/AISettingsTab-BmhNcUEh.js +0 -1
- package/dist-cli-web/assets/AboutTab-CFklrZt8.js +0 -1
- package/dist-cli-web/assets/ActionToolsPanel.vue_vue_type_script_setup_true_lang-B-dIPvcs.js +0 -110
- package/dist-cli-web/assets/ApiSettingsTab-DvDm421U.js +0 -2
- package/dist-cli-web/assets/BatchManageTab-DhIDH3Q1.js +0 -1
- package/dist-cli-web/assets/ChatRecordDrawer-DHdas7Jp.js +0 -1
- package/dist-cli-web/assets/DataDirCleanupNotice-jebQ9il3.js +0 -1
- package/dist-cli-web/assets/DatePicker.vue_vue_type_script_setup_true_lang-Cal624eP.js +0 -1
- package/dist-cli-web/assets/EChart.vue_vue_type_script_setup_true_lang-CsgJ-Xn3.js +0 -1
- package/dist-cli-web/assets/GlobalTaskBar-BvNmFO7q.js +0 -1
- package/dist-cli-web/assets/GroupRelationshipGalaxyView-DEUIrvgz.js +0 -1
- package/dist-cli-web/assets/LoadingState.vue_vue_type_script_setup_true_lang-CwDIA0UP.js +0 -1
- package/dist-cli-web/assets/MessageExportModal-DYjhBuzO.js +0 -1
- package/dist-cli-web/assets/RelationshipGalaxyThreeCanvas-CqdqveEJ.js +0 -4108
- package/dist-cli-web/assets/RelationshipGalaxyThreeCanvas-TYGOUDiv.css +0 -1
- package/dist-cli-web/assets/RovingFocusItem-j33Nsbbn.js +0 -1
- package/dist-cli-web/assets/SectionTabs.vue_vue_type_script_setup_true_lang-C6EHKB_i.js +0 -1
- package/dist-cli-web/assets/SettingsModal-CjVax3I6.css +0 -1
- package/dist-cli-web/assets/SettingsModal-Dg27piEO.js +0 -2
- package/dist-cli-web/assets/Tabs-CRZdCcU4.js +0 -1
- package/dist-cli-web/assets/TimeSelect.vue_vue_type_script_setup_true_lang-BLpQds4F.js +0 -1
- package/dist-cli-web/assets/aiChat-4JvxWGXZ.js +0 -8
- package/dist-cli-web/assets/base-D6fxqD_X.js +0 -1
- package/dist-cli-web/assets/dateFormat-Bu4-Ux3L.js +0 -1
- package/dist-cli-web/assets/index-BUz_Vl9U.js +0 -2
- package/dist-cli-web/assets/index-BWZIoPV3.css +0 -1
- package/dist-cli-web/assets/index-BYQV3OA5.js +0 -1
- package/dist-cli-web/assets/index-CVVv_6qu.js +0 -2
- package/dist-cli-web/assets/index-CacwXQL4.js +0 -1
- package/dist-cli-web/assets/index-DImo7TQN.js +0 -1
- package/dist-cli-web/assets/index-DV9zQVPV.js +0 -137
- package/dist-cli-web/assets/index-DXKS-q-w.css +0 -1
- package/dist-cli-web/assets/index-DZc5A4_J.js +0 -1
- package/dist-cli-web/assets/index-DkWTvE7d.js +0 -36
- package/dist-cli-web/assets/index-DmEn0PAI.js +0 -1
- package/dist-cli-web/assets/index-b9eEQeVt.js +0 -1
- package/dist-cli-web/assets/index-waDxab2e.css +0 -1
- package/dist-cli-web/assets/insight-time-range-MJxLEu6o.js +0 -1
- package/dist-cli-web/assets/useTable-C7BH94MF.js +0 -1
- package/dist-cli-web/assets/useToast-CxhJkhXK.js +0 -1
- /package/dist/{chunk-VDWI4A4U.mjs.map → chunk-5MJO4AJB.mjs.map} +0 -0
- /package/dist/{chunk-GVW3BDGZ.mjs.map → chunk-67HNPYZJ.mjs.map} +0 -0
- /package/dist/{chunk-UNIKQFI5.mjs.map → chunk-6QP47LID.mjs.map} +0 -0
- /package/dist/{chunk-XDF6PMVZ.mjs.map → chunk-JOVL7OTW.mjs.map} +0 -0
- /package/dist/{chunk-U2NXHIJK.mjs.map → chunk-NFTCEJBJ.mjs.map} +0 -0
- /package/dist/{chunk-AAGDVTP2.mjs.map → chunk-NQHZPSW2.mjs.map} +0 -0
- /package/dist/{http-LVOGJFDL.mjs.map → http-5RVY5J5U.mjs.map} +0 -0
- /package/dist/{import-7OU57ZHM.mjs.map → import-ILTWVHKU.mjs.map} +0 -0
- /package/dist/{mcp-CUKHTTII.mjs.map → mcp-Y2YXOFB4.mjs.map} +0 -0
- /package/dist/{src-LORFXAUE.mjs.map → src-OV5ZNE3Z.mjs.map} +0 -0
- /package/dist/{stream-import-7YUWIAD6.mjs.map → stream-import-XOUM3Z5W.mjs.map} +0 -0
- /package/dist/{worker-runtime-GQ5SY7E3.mjs.map → worker-runtime-JNGURHDM.mjs.map} +0 -0
|
@@ -826,6 +826,9 @@ function isSupportedChatLabFormatVersion(version) {
|
|
|
826
826
|
}
|
|
827
827
|
|
|
828
828
|
// ../../packages/shared-types/index.ts
|
|
829
|
+
var ANNUAL_SUMMARY_PLUGIN_ID = "chatlab.insight.annual-summary";
|
|
830
|
+
var TIME_INVESTMENT_PLUGIN_ID = "chatlab.insight.time-investment";
|
|
831
|
+
var NAVIGATION_LAYOUT_SCHEMA_VERSION = 1;
|
|
829
832
|
var MessageType = /* @__PURE__ */ ((MessageType2) => {
|
|
830
833
|
MessageType2[MessageType2["TEXT"] = 0] = "TEXT";
|
|
831
834
|
MessageType2[MessageType2["IMAGE"] = 1] = "IMAGE";
|
|
@@ -10438,6 +10441,7 @@ function createActivateSkillTool(options) {
|
|
|
10438
10441
|
},
|
|
10439
10442
|
required: ["skill_id"]
|
|
10440
10443
|
},
|
|
10444
|
+
executionMode: "sequential",
|
|
10441
10445
|
execute: async (_toolCallId, params) => {
|
|
10442
10446
|
const toolParams = params && typeof params === "object" ? params : {};
|
|
10443
10447
|
const skillId = toolParams.skill_id || "";
|
|
@@ -10978,10 +10982,33 @@ function forceTruncate(input, targetTokens) {
|
|
|
10978
10982
|
return result.join("\n") || input.slice(0, targetTokens * 3);
|
|
10979
10983
|
}
|
|
10980
10984
|
|
|
10981
|
-
// ../../packages/node-runtime/src/ai/
|
|
10985
|
+
// ../../packages/node-runtime/src/ai/pi-runtime.ts
|
|
10982
10986
|
import {
|
|
10983
|
-
|
|
10987
|
+
lazyApi,
|
|
10988
|
+
lazyStream
|
|
10984
10989
|
} from "@earendil-works/pi-ai";
|
|
10990
|
+
var apiStreams = {
|
|
10991
|
+
"openai-completions": lazyApi(() => import("@earendil-works/pi-ai/api/openai-completions")),
|
|
10992
|
+
"openai-responses": lazyApi(() => import("@earendil-works/pi-ai/api/openai-responses")),
|
|
10993
|
+
"anthropic-messages": lazyApi(() => import("@earendil-works/pi-ai/api/anthropic-messages")),
|
|
10994
|
+
"google-generative-ai": lazyApi(() => import("@earendil-works/pi-ai/api/google-generative-ai"))
|
|
10995
|
+
};
|
|
10996
|
+
function isSupportedApi(api) {
|
|
10997
|
+
return Object.hasOwn(apiStreams, api);
|
|
10998
|
+
}
|
|
10999
|
+
function streamSimple(model, context, options) {
|
|
11000
|
+
if (!isSupportedApi(model.api)) {
|
|
11001
|
+
return lazyStream(model, async () => {
|
|
11002
|
+
throw new Error(`Unsupported ChatLab AI API format: ${model.api}`);
|
|
11003
|
+
});
|
|
11004
|
+
}
|
|
11005
|
+
return apiStreams[model.api].streamSimple(model, context, options);
|
|
11006
|
+
}
|
|
11007
|
+
function completeSimple(model, context, options) {
|
|
11008
|
+
return streamSimple(model, context, options).result();
|
|
11009
|
+
}
|
|
11010
|
+
|
|
11011
|
+
// ../../packages/node-runtime/src/ai/compression/adapter-factory.ts
|
|
10985
11012
|
var DEFAULT_CONTEXT_WINDOW2 = 128e3;
|
|
10986
11013
|
function createCompressionLlmAdapter(options) {
|
|
10987
11014
|
const { piModel, apiKey, onCompressing, onError } = options;
|
|
@@ -11738,10 +11765,7 @@ var DEFAULT_MAX_TOOL_ROUNDS = 20;
|
|
|
11738
11765
|
|
|
11739
11766
|
// ../../packages/node-runtime/src/ai/agent/core.ts
|
|
11740
11767
|
import { Agent as PiAgentCore } from "@earendil-works/pi-agent-core";
|
|
11741
|
-
import {
|
|
11742
|
-
streamSimple as defaultStreamSimple,
|
|
11743
|
-
clampThinkingLevel
|
|
11744
|
-
} from "@earendil-works/pi-ai";
|
|
11768
|
+
import { clampThinkingLevel } from "@earendil-works/pi-ai";
|
|
11745
11769
|
function isPiMessage(message) {
|
|
11746
11770
|
return message.role === "user" || message.role === "assistant" || message.role === "toolResult";
|
|
11747
11771
|
}
|
|
@@ -11761,7 +11785,7 @@ async function runAgentCore(options) {
|
|
|
11761
11785
|
onDebugContext
|
|
11762
11786
|
} = options;
|
|
11763
11787
|
await initTokenizer();
|
|
11764
|
-
const resolvedStreamFn = options.streamFn ??
|
|
11788
|
+
const resolvedStreamFn = options.streamFn ?? streamSimple;
|
|
11765
11789
|
const totalUsage = {
|
|
11766
11790
|
promptTokens: 0,
|
|
11767
11791
|
completionTokens: 0,
|
|
@@ -11797,6 +11821,7 @@ async function runAgentCore(options) {
|
|
|
11797
11821
|
return clampThinkingLevel(piModel, level);
|
|
11798
11822
|
})();
|
|
11799
11823
|
const finalThinkingLevel = resolvedThinkingLevel ?? (piModel.reasoning ? void 0 : "off");
|
|
11824
|
+
let hasReachedToolRoundLimit = false;
|
|
11800
11825
|
const thinkingFormat = piModel.compat?.thinkingFormat;
|
|
11801
11826
|
const replayOptions = piModel.reasoning && thinkingFormat === "deepseek" ? {
|
|
11802
11827
|
modelInfo: { api: piModel.api, provider: piModel.provider, id: piModel.id },
|
|
@@ -11818,9 +11843,17 @@ async function runAgentCore(options) {
|
|
|
11818
11843
|
);
|
|
11819
11844
|
onConvertToLlm?.(filtered);
|
|
11820
11845
|
return filtered;
|
|
11821
|
-
}
|
|
11846
|
+
},
|
|
11847
|
+
prepareNextTurn: () => hasReachedToolRoundLimit ? {
|
|
11848
|
+
context: {
|
|
11849
|
+
systemPrompt,
|
|
11850
|
+
messages: coreAgent.state.messages,
|
|
11851
|
+
tools: []
|
|
11852
|
+
}
|
|
11853
|
+
} : void 0,
|
|
11854
|
+
sessionId: options.providerSessionId,
|
|
11855
|
+
toolExecution: "parallel"
|
|
11822
11856
|
});
|
|
11823
|
-
let hasReachedToolRoundLimit = false;
|
|
11824
11857
|
const thinkingStartTime = /* @__PURE__ */ new Map();
|
|
11825
11858
|
const useThinkParser = needsStreamingThinkParsing(piModel.provider, piModel.id);
|
|
11826
11859
|
let thinkParserStartTime;
|
|
@@ -11872,6 +11905,16 @@ async function runAgentCore(options) {
|
|
|
11872
11905
|
toolName: event.toolName,
|
|
11873
11906
|
toolParams: event.args || {}
|
|
11874
11907
|
});
|
|
11908
|
+
} else if (event.type === "tool_execution_update") {
|
|
11909
|
+
const details = event.partialResult?.details;
|
|
11910
|
+
if (details?.progress) {
|
|
11911
|
+
onEvent({
|
|
11912
|
+
type: "tool_update",
|
|
11913
|
+
toolCallId: event.toolCallId,
|
|
11914
|
+
toolName: event.toolName,
|
|
11915
|
+
progress: details.progress
|
|
11916
|
+
});
|
|
11917
|
+
}
|
|
11875
11918
|
} else if (event.type === "tool_execution_end") {
|
|
11876
11919
|
onEvent({
|
|
11877
11920
|
type: "tool_end",
|
|
@@ -12007,9 +12050,6 @@ notes:
|
|
|
12007
12050
|
}
|
|
12008
12051
|
|
|
12009
12052
|
// ../../packages/node-runtime/src/ai/agent/router.ts
|
|
12010
|
-
import {
|
|
12011
|
-
completeSimple as completeSimple2
|
|
12012
|
-
} from "@earendil-works/pi-ai";
|
|
12013
12053
|
var DEFAULT_LLM_FALLBACK_CONFIDENCE_THRESHOLD = 0.6;
|
|
12014
12054
|
function clampConfidence(value) {
|
|
12015
12055
|
if (!Number.isFinite(value)) return 0;
|
|
@@ -12212,7 +12252,7 @@ async function completeWithPiAi(prompt, options) {
|
|
|
12212
12252
|
if (!options.piModel || !options.apiKey) {
|
|
12213
12253
|
throw new Error("LLM router requires piModel and apiKey");
|
|
12214
12254
|
}
|
|
12215
|
-
const result = await
|
|
12255
|
+
const result = await completeSimple(
|
|
12216
12256
|
options.piModel,
|
|
12217
12257
|
{
|
|
12218
12258
|
systemPrompt: "You are a strict JSON classifier for ChatLab AI routing. Return JSON only.",
|
|
@@ -12237,10 +12277,6 @@ async function completeWithPiAi(prompt, options) {
|
|
|
12237
12277
|
}
|
|
12238
12278
|
|
|
12239
12279
|
// ../../packages/node-runtime/src/ai/agent/planner.ts
|
|
12240
|
-
import {
|
|
12241
|
-
completeSimple as completeSimple3,
|
|
12242
|
-
streamSimple
|
|
12243
|
-
} from "@earendil-works/pi-ai";
|
|
12244
12280
|
var PLAN_INTENTS = [
|
|
12245
12281
|
"summary",
|
|
12246
12282
|
"trend",
|
|
@@ -12405,7 +12441,7 @@ async function completeWithPiAi2(prompt, options, signal) {
|
|
|
12405
12441
|
if (!options.piModel || !options.apiKey) {
|
|
12406
12442
|
throw new Error("Planner requires piModel and apiKey");
|
|
12407
12443
|
}
|
|
12408
|
-
const result = await
|
|
12444
|
+
const result = await completeSimple(
|
|
12409
12445
|
options.piModel,
|
|
12410
12446
|
{
|
|
12411
12447
|
systemPrompt: "You are a strict planner for ChatLab analysis. Return the requested blocks only.",
|
|
@@ -12601,6 +12637,7 @@ var AgentEventHandler = class {
|
|
|
12601
12637
|
onChunk;
|
|
12602
12638
|
context;
|
|
12603
12639
|
systemPrompt;
|
|
12640
|
+
activeTools = /* @__PURE__ */ new Map();
|
|
12604
12641
|
constructor(config) {
|
|
12605
12642
|
this.onChunk = config.onChunk;
|
|
12606
12643
|
this.context = config.context;
|
|
@@ -12626,11 +12663,21 @@ var AgentEventHandler = class {
|
|
|
12626
12663
|
case "tool_start": {
|
|
12627
12664
|
const params = this.normalizeToolParams(event.toolName, event.toolParams);
|
|
12628
12665
|
this.toolsUsed.push(event.toolName);
|
|
12666
|
+
this.activeTools.set(event.toolCallId, event.toolName);
|
|
12629
12667
|
this.onChunk({ type: "tool_start", toolCallId: event.toolCallId, toolName: event.toolName, toolParams: params });
|
|
12630
12668
|
this.emitStatus("tool_running", messages, { currentTool: event.toolName, force: true });
|
|
12631
12669
|
break;
|
|
12632
12670
|
}
|
|
12671
|
+
case "tool_update":
|
|
12672
|
+
this.onChunk({
|
|
12673
|
+
type: "tool_update",
|
|
12674
|
+
toolCallId: event.toolCallId,
|
|
12675
|
+
toolName: event.toolName,
|
|
12676
|
+
toolProgress: event.progress
|
|
12677
|
+
});
|
|
12678
|
+
break;
|
|
12633
12679
|
case "tool_end":
|
|
12680
|
+
this.activeTools.delete(event.toolCallId);
|
|
12634
12681
|
this.onChunk({
|
|
12635
12682
|
type: "tool_result",
|
|
12636
12683
|
toolCallId: event.toolCallId,
|
|
@@ -12638,9 +12685,15 @@ var AgentEventHandler = class {
|
|
|
12638
12685
|
toolResult: event.toolResult,
|
|
12639
12686
|
toolIsError: event.isError
|
|
12640
12687
|
});
|
|
12641
|
-
this.
|
|
12688
|
+
if (this.activeTools.size > 0) {
|
|
12689
|
+
const currentTool = Array.from(this.activeTools.values()).at(-1);
|
|
12690
|
+
this.emitStatus("tool_running", messages, { currentTool, force: true });
|
|
12691
|
+
} else {
|
|
12692
|
+
this.emitStatus("thinking", messages, { force: true });
|
|
12693
|
+
}
|
|
12642
12694
|
break;
|
|
12643
12695
|
case "turn_end":
|
|
12696
|
+
this.activeTools.clear();
|
|
12644
12697
|
this.toolRounds = event.round;
|
|
12645
12698
|
this.emitStatus("thinking", messages, { force: true });
|
|
12646
12699
|
break;
|
|
@@ -15173,7 +15226,6 @@ function buildPiModel(config, options) {
|
|
|
15173
15226
|
}
|
|
15174
15227
|
|
|
15175
15228
|
// ../../packages/node-runtime/src/ai/remote-api.ts
|
|
15176
|
-
import { completeSimple as completeSimple4 } from "@earendil-works/pi-ai";
|
|
15177
15229
|
async function fetchRemoteModels(provider, apiKey, baseUrl, apiFormat, options) {
|
|
15178
15230
|
const effectiveApiFormat = apiFormat || "openai-completions";
|
|
15179
15231
|
if (effectiveApiFormat === "anthropic-messages") {
|
|
@@ -15257,7 +15309,7 @@ async function validateApiKey(provider, apiKey, baseUrl, model, apiFormat, optio
|
|
|
15257
15309
|
const abortController = new AbortController();
|
|
15258
15310
|
const timeout = setTimeout(() => abortController.abort(), 15e3);
|
|
15259
15311
|
try {
|
|
15260
|
-
const result = await
|
|
15312
|
+
const result = await completeSimple(
|
|
15261
15313
|
piModel,
|
|
15262
15314
|
{ messages: [{ role: "user", content: "Hi", timestamp: Date.now() }] },
|
|
15263
15315
|
{ apiKey, maxTokens: 1, signal: abortController.signal }
|
|
@@ -15278,7 +15330,6 @@ async function validateApiKey(provider, apiKey, baseUrl, model, apiFormat, optio
|
|
|
15278
15330
|
}
|
|
15279
15331
|
|
|
15280
15332
|
// ../../packages/node-runtime/src/ai/llm-stream.ts
|
|
15281
|
-
import { streamSimple as streamSimple2 } from "@earendil-works/pi-ai";
|
|
15282
15333
|
function toPiMessages(messages, timestamp) {
|
|
15283
15334
|
return messages.map((m) => ({
|
|
15284
15335
|
role: m.role,
|
|
@@ -15291,7 +15342,7 @@ async function runSimpleLlmStream(options) {
|
|
|
15291
15342
|
const systemMsg = messages.find((m) => m.role === "system");
|
|
15292
15343
|
const nonSystemMsgs = messages.filter((m) => m.role !== "system");
|
|
15293
15344
|
const now = Date.now();
|
|
15294
|
-
const eventStream =
|
|
15345
|
+
const eventStream = streamSimple(
|
|
15295
15346
|
piModel,
|
|
15296
15347
|
{
|
|
15297
15348
|
systemPrompt: systemMsg?.content,
|
|
@@ -15349,7 +15400,7 @@ async function runSimpleLlmStream(options) {
|
|
|
15349
15400
|
}
|
|
15350
15401
|
|
|
15351
15402
|
// ../../packages/node-runtime/src/ai/index.ts
|
|
15352
|
-
import { Type
|
|
15403
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
15353
15404
|
|
|
15354
15405
|
// ../../packages/node-runtime/src/migrations/electron-data-migration.ts
|
|
15355
15406
|
import * as fs10 from "fs";
|
|
@@ -16186,7 +16237,7 @@ var CHAT_TOPIC_MODEL_TIMEOUT_MS = 12e4;
|
|
|
16186
16237
|
function createChatTopicModelClient(config, deps = {}) {
|
|
16187
16238
|
const model = buildPiModel(config);
|
|
16188
16239
|
const modelId = `${config.provider}/${model.id}`;
|
|
16189
|
-
const runCompletion = deps.completeSimple ??
|
|
16240
|
+
const runCompletion = deps.completeSimple ?? completeSimple;
|
|
16190
16241
|
return {
|
|
16191
16242
|
modelId,
|
|
16192
16243
|
async complete(prompts, options) {
|
|
@@ -18856,6 +18907,9 @@ export {
|
|
|
18856
18907
|
CHATLAB_FORMAT_VERSION,
|
|
18857
18908
|
CHATLAB_SUPPORTED_FORMAT_VERSIONS,
|
|
18858
18909
|
isSupportedChatLabFormatVersion,
|
|
18910
|
+
ANNUAL_SUMMARY_PLUGIN_ID,
|
|
18911
|
+
TIME_INVESTMENT_PLUGIN_ID,
|
|
18912
|
+
NAVIGATION_LAYOUT_SCHEMA_VERSION,
|
|
18859
18913
|
MessageType,
|
|
18860
18914
|
KNOWN_PLATFORMS,
|
|
18861
18915
|
getDefaultGeneralAssistantId,
|
|
@@ -18955,6 +19009,8 @@ export {
|
|
|
18955
19009
|
DEFAULT_CONTEXT_COMPRESSION_CONFIG,
|
|
18956
19010
|
checkAndCompress,
|
|
18957
19011
|
manualCompress,
|
|
19012
|
+
streamSimple,
|
|
19013
|
+
completeSimple,
|
|
18958
19014
|
createCompressionLlmAdapter,
|
|
18959
19015
|
preprocessMessages,
|
|
18960
19016
|
preprocessMessagesWithStats,
|
|
@@ -19009,8 +19065,6 @@ export {
|
|
|
19009
19065
|
validateApiKey,
|
|
19010
19066
|
runSimpleLlmStream,
|
|
19011
19067
|
Type,
|
|
19012
|
-
completeSimple5 as completeSimple,
|
|
19013
|
-
streamSimple3 as streamSimple,
|
|
19014
19068
|
wasElectronUsed,
|
|
19015
19069
|
verifyCliDataPath,
|
|
19016
19070
|
migrateFromElectronIfNeeded,
|
|
@@ -19069,4 +19123,4 @@ export {
|
|
|
19069
19123
|
StaticPathProvider,
|
|
19070
19124
|
createDatabaseManagerAdapter
|
|
19071
19125
|
};
|
|
19072
|
-
//# sourceMappingURL=chunk-
|
|
19126
|
+
//# sourceMappingURL=chunk-Q3NEL2KK.mjs.map
|