@vibe-lark/larkpal 0.1.86 → 0.1.87
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/account-id-BM1T6029-BzQ_cMoi.mjs +1 -0
- package/dist/activation-context--5yu1dPF-XV0Y0pTy.mjs +1 -0
- package/dist/anthropic-CFZUCb1w.mjs +39 -0
- package/dist/assistant-visible-text-DuFWokAt-BOJV_zwc.mjs +9 -0
- package/dist/azure-openai-responses-BEuiMaF-.mjs +1 -0
- package/dist/boundary-file-read-BSd9MXPy-gnNVhPKT.mjs +1 -0
- package/dist/browser-lifecycle-cleanup-BdNsMhMD-BM97qA_M.mjs +1 -0
- package/dist/build-Bkj0hOS2.mjs +3 -0
- package/dist/bundled-compat-BpaDaAAu-DJtrIX6i.mjs +27 -0
- package/dist/bundled-dir-U738ay4K-BxbzrJOo.mjs +1 -0
- package/dist/call-DimWbpgJ-B4pv55RH.mjs +20 -0
- package/dist/channel-bootstrap.runtime-BVclcGv1-CEZ0-JP9.mjs +1 -0
- package/dist/channel-bootstrap.runtime-Cwcr38m2-Dt6QlQkX.mjs +1 -0
- package/dist/chunk-DHbaKqs-.mjs +1 -0
- package/dist/cli.mjs +7 -92
- package/dist/command-format-LSnUCVVF-Dn4h9IOh.mjs +16 -0
- package/dist/config-Bim2pi8a-03N-28sw.mjs +1 -0
- package/dist/delivery-context.shared-j5hC5qb1-BSLQG47q.mjs +1 -0
- package/dist/diagnostic-ClMwNnUA-BMKvPQJT.mjs +1 -0
- package/dist/dist-J5UB83Ws.mjs +601 -0
- package/dist/dist-coestTs9.mjs +5 -0
- package/dist/env-api-keys-Cuz5irWW.mjs +1 -0
- package/dist/event-stream-B7Ei41Bu.mjs +1 -0
- package/dist/facade-loader-DFzIYYt_-4bzFvy-b.mjs +1 -0
- package/dist/from-Ba69_5cR.mjs +14 -0
- package/dist/gateway-method-policy-C7rf0SeV-CTJcMQCE.mjs +1 -0
- package/dist/github-copilot-headers-BfhryVuU.mjs +1 -0
- package/dist/google-ABo-1guT.mjs +1 -0
- package/dist/google-gemini-cli-CGlN1zUA.mjs +2 -0
- package/dist/google-shared-C60sNhwd.mjs +301 -0
- package/dist/google-vertex-De0nAItu.mjs +1 -0
- package/dist/hash-Dw-N8Y9l.mjs +1 -0
- package/dist/headers-Bpsp70B9.mjs +1 -0
- package/dist/home-dir-C44RaPME-B5iLWwCq.mjs +1 -0
- package/dist/ids-BPsM98Uu-CJBJAeVC.mjs +1 -0
- package/dist/image-2w3cApg7-CrpUMCvm.mjs +3 -0
- package/dist/interactive-init-C5MFL5MW.mjs +8 -0
- package/dist/io-CH2g3vsv-JJtUIa_U.mjs +10 -0
- package/dist/jiti-loader-cache-Bat69wam-DNIteTtO.mjs +9 -0
- package/dist/json-file-BQRNuxmK-hRjIgOXI.mjs +1 -0
- package/dist/json-parse-BESd8UAM.mjs +3 -0
- package/dist/jws-YaZ38F_i.mjs +12 -0
- package/dist/lark-cli-provider-BLMxH6CN.mjs +4 -0
- package/dist/lark-logger-xpMKNNtY.mjs +1 -0
- package/dist/live-smoke-DpURW676.mjs +33 -0
- package/dist/load-context-mb7uvLSn-3xYwSnOZ.mjs +1 -0
- package/dist/loader-708jrx4Y-BbJRXNlQ.mjs +4 -0
- package/dist/main.mjs +153 -74571
- package/dist/manifest-registry-_hxKCS2K-OL8KK_o4.mjs +15 -0
- package/dist/mcp-server.mjs +4 -527
- package/dist/message-channel-Bk_YHfQg-n2Hw2Y0L.mjs +1 -0
- package/dist/message-channel-core-DTA--Gjh-CIh10vfo.mjs +1 -0
- package/dist/message.config.runtime-K-k4XOyq-F_h0Cgkl.mjs +1 -0
- package/dist/message.gateway.runtime-DqHOHRTQ-ge4c5p4s.mjs +1 -0
- package/dist/mistral-DyL3Zo1b.mjs +7 -0
- package/dist/model-auth-env-oyg2Hexc-DJbt9J3o.mjs +1 -0
- package/dist/models-config-BmpSQJQF-BL6S5qAo.mjs +1 -0
- package/dist/models-config.runtime-SOhLEw-f.mjs +1 -0
- package/dist/multipart-parser-B9dwXBqu.mjs +2 -0
- package/dist/oauth-25y2wc7K.mjs +75 -0
- package/dist/openai-C-rgGb7X.mjs +16 -0
- package/dist/openai-codex-responses-BbyAPsP1.mjs +7 -0
- package/dist/openai-completions-Bu5qvQzb.mjs +5 -0
- package/dist/openai-responses-pIdwQBc4.mjs +1 -0
- package/dist/openai-responses-shared-DqW1JSux.mjs +10 -0
- package/dist/paths-D6msg0S1-BO4XgM1u.mjs +1 -0
- package/dist/paths-D92DjaZ--DdtJ-zYp.mjs +1 -0
- package/dist/pi-model-discovery-Bd0TWzo8-DvSM0eWu.mjs +1 -0
- package/dist/pi-model-discovery-runtime-PrjWOmsV.mjs +1 -0
- package/dist/pi-tools.before-tool-call.runtime-Bn7uqKie-WPxU5oNX.mjs +2 -0
- package/dist/plugin-auto-enable-DdH3n9V8-Dr_bUXkG.mjs +1 -0
- package/dist/process-scoped-map-B2cWkYET-Co-i-MXA.mjs +1 -0
- package/dist/provider-discovery.runtime-DY0VWQ81.mjs +1 -0
- package/dist/provider-model-compat-CFqcq0it-BUwZENrz.mjs +1 -0
- package/dist/provider-runtime-C8rljsNs-BDvu6FW3.mjs +1 -0
- package/dist/provider-runtime-CT50mNIX-DImw7ZZu.mjs +79 -0
- package/dist/provider-stream-COLujAAo-Dpq1DSIk.mjs +248 -0
- package/dist/providers.runtime-Ba7tOlq7-B4t6ywCr.mjs +1 -0
- package/dist/public-surface-loader-BVl0NQAE-TfJ3izj1.mjs +1 -0
- package/dist/resolve-C33B7eeu-DZM_z6Wr.mjs +1 -0
- package/dist/runtime-Cym-fqI8-1GOIuRRQ.mjs +1 -0
- package/dist/runtime-channel-state-CohMybAh-BBzhl07Q.mjs +1 -0
- package/dist/runtime-snapshot-C54O1-gI-DxusscPf.mjs +1 -0
- package/dist/runtime-state-IBOIXKOx-Cw1GA1td.mjs +1 -0
- package/dist/runtime-web-tools-fallback.runtime-Ca-qn1mj-BsYE2gOd.mjs +1 -0
- package/dist/runtime-web-tools-manifest.runtime-BgxQTjmq-P6MKP9gQ.mjs +1 -0
- package/dist/runtime-web-tools-public-artifacts.runtime-D9qcoWIX-5VoyjouO.mjs +1 -0
- package/dist/session-archive.runtime-B52_5vs4-cU2tYbBz.mjs +1 -0
- package/dist/session-key-Cn2QoOyX-QZeYmbxd.mjs +1 -0
- package/dist/session-transcript-files.fs-DEeFXruQ-CXIAFSsr.mjs +1 -0
- package/dist/src-CCDx_C-U.mjs +3 -0
- package/dist/src-DACmA9V6.mjs +5 -0
- package/dist/subagent-announce-L5WsQatW--rMn240x.mjs +2 -0
- package/dist/subagent-announce.registry.runtime-DiqZyeTs-DNfNHsls.mjs +1 -0
- package/dist/subagent-registry-steer-runtime-DFgZFC0j-XYS1_qwl.mjs +1 -0
- package/dist/subagent-system-prompt-C1qnN--K-CsU4f97T.mjs +23 -0
- package/dist/target-parsing-loaded-DKkb6jJY-B830OA1a.mjs +12 -0
- package/dist/task-registry-delivery-runtime-Dd1CUkZF-B2Hj2k8C.mjs +16 -0
- package/dist/task-registry-delivery-runtime-ragbeVx5-Bdvo2Q5u.mjs +1 -0
- package/dist/thinking-Bh-7MqXz-uApNUe6g.mjs +1 -0
- package/dist/transcript-E_-ISOkD-VTwb782D.mjs +5 -0
- package/dist/transcript.runtime-BqhvZZdl-B4E0TiX5.mjs +1 -0
- package/dist/transform-messages-BTA3xbAI.mjs +1 -0
- package/dist/web-provider-public-artifacts-BlpRwIUS-DbVhDOrY.mjs +1 -0
- package/dist/web-search-providers.runtime--0aUtC3b-Bjh4Bmrz.mjs +1 -0
- package/package.json +2 -3
- package/dist/account-id-BM1T6029-DYjVxojW.mjs +0 -46
- package/dist/activation-context--5yu1dPF-Bwsn3moT.mjs +0 -172
- package/dist/anthropic-TH8ERTXK.mjs +0 -5962
- package/dist/assistant-visible-text-DuFWokAt-CsbII5KS.mjs +0 -596
- package/dist/azure-openai-responses-Bt_Ag9Er.mjs +0 -166
- package/dist/boundary-file-read-BSd9MXPy--KThL5e6.mjs +0 -594
- package/dist/browser-lifecycle-cleanup-BdNsMhMD-O3tnAM4i.mjs +0 -60
- package/dist/build-DgTrEpge.mjs +0 -3333
- package/dist/bundled-compat-BpaDaAAu-D7oazKjD.mjs +0 -5216
- package/dist/bundled-dir-U738ay4K-DXK0q_TV.mjs +0 -258
- package/dist/call-DimWbpgJ-ColD4W-y.mjs +0 -9993
- package/dist/channel-bootstrap.runtime-BVclcGv1-DJv_Z-Kr.mjs +0 -2
- package/dist/channel-bootstrap.runtime-Cwcr38m2-VRfVCR-i.mjs +0 -33
- package/dist/chunk-D6SyT4dJ.mjs +0 -36
- package/dist/command-format-LSnUCVVF-BQ2SMKka.mjs +0 -685
- package/dist/config-Bim2pi8a-BQUdfiEi.mjs +0 -9
- package/dist/delivery-context.shared-j5hC5qb1-CI83RXXZ.mjs +0 -72
- package/dist/diagnostic-ClMwNnUA-D6nUtLnb.mjs +0 -140
- package/dist/dist-CEGw8-2W.mjs +0 -429
- package/dist/dist-DD2aJ2UL.mjs +0 -125135
- package/dist/env-api-keys-BVvSg7T2.mjs +0 -68
- package/dist/event-stream-xaQWmyas.mjs +0 -15226
- package/dist/facade-loader-DFzIYYt_-CIr4HKtE.mjs +0 -194
- package/dist/from-DF7cl2wz.mjs +0 -3842
- package/dist/gateway-method-policy-C7rf0SeV-CJQMEYIE.mjs +0 -28
- package/dist/github-copilot-headers-DjqWtUoP.mjs +0 -22
- package/dist/google-C2pVrgBZ.mjs +0 -336
- package/dist/google-gemini-cli-BBxgS5Ho.mjs +0 -623
- package/dist/google-shared-BsWgwEk1.mjs +0 -22791
- package/dist/google-vertex-BsVLJrrC.mjs +0 -358
- package/dist/hash-DAFtW_W7.mjs +0 -16
- package/dist/headers-R3HdCbAE.mjs +0 -8
- package/dist/home-dir-C44RaPME-CBRS4HLP.mjs +0 -93
- package/dist/ids-BPsM98Uu-CwuxvUai.mjs +0 -77
- package/dist/image-2w3cApg7-CxpHvoB5.mjs +0 -207
- package/dist/interactive-init-BXQBalNr.mjs +0 -450
- package/dist/io-CH2g3vsv-BOGlLlB8.mjs +0 -26218
- package/dist/jiti-loader-cache-Bat69wam-D6hCxboy.mjs +0 -5049
- package/dist/json-file-BQRNuxmK-DhJM5NsG.mjs +0 -108
- package/dist/json-parse-v_HIJjjI.mjs +0 -381
- package/dist/jws-GFcTvvVT.mjs +0 -2291
- package/dist/lark-cli-provider-BARgbbmo.mjs +0 -554
- package/dist/lark-logger-D7_pEVQc.mjs +0 -143
- package/dist/live-smoke-BhkBOcH9.mjs +0 -7135
- package/dist/load-context-mb7uvLSn-B10MAi3I.mjs +0 -29
- package/dist/loader-708jrx4Y-BOswuvpe.mjs +0 -5053
- package/dist/manifest-registry-_hxKCS2K-CZdeyN0f.mjs +0 -3512
- package/dist/message-channel-Bk_YHfQg-AeNrPPpp.mjs +0 -50
- package/dist/message-channel-core-DTA--Gjh-CY4Tkb7N.mjs +0 -29
- package/dist/message.config.runtime-K-k4XOyq-DZTmXomP.mjs +0 -2
- package/dist/message.gateway.runtime-DqHOHRTQ-DH4ml0YF.mjs +0 -2
- package/dist/mistral-CaR4DiLu.mjs +0 -28657
- package/dist/model-auth-env-oyg2Hexc-DU_rOUU5.mjs +0 -1306
- package/dist/models-config-BmpSQJQF-Gfvh1n3A.mjs +0 -1282
- package/dist/models-config.runtime-BsU_22xk.mjs +0 -2
- package/dist/multipart-parser-DedmaB5g.mjs +0 -294
- package/dist/oauth-DOJeGfcE.mjs +0 -6392
- package/dist/openai-BDtIh3Ja.mjs +0 -6693
- package/dist/openai-codex-responses-C5EORu31.mjs +0 -664
- package/dist/openai-completions-CR_cS6gX.mjs +0 -669
- package/dist/openai-responses-oGxwZyuC.mjs +0 -184
- package/dist/openai-responses-shared-BixMSDZE.mjs +0 -398
- package/dist/paths-D6msg0S1-C2lYuisN.mjs +0 -189
- package/dist/paths-D92DjaZ--CTOESW2b.mjs +0 -192
- package/dist/pi-model-discovery-Bd0TWzo8-BFsJmeMb.mjs +0 -227
- package/dist/pi-model-discovery-runtime-CCCZxkd8.mjs +0 -2
- package/dist/pi-tools.before-tool-call.runtime-Bn7uqKie-C5ewk8kK.mjs +0 -399
- package/dist/plugin-auto-enable-DdH3n9V8-DsA1isaF.mjs +0 -1456
- package/dist/process-scoped-map-B2cWkYET-CXwUZ8CZ.mjs +0 -61
- package/dist/provider-discovery.runtime-BPzz1PFj.mjs +0 -58
- package/dist/provider-model-compat-CFqcq0it-BDDuBI3A.mjs +0 -118
- package/dist/provider-runtime-C8rljsNs-CIT93zoy.mjs +0 -2
- package/dist/provider-runtime-CT50mNIX-BwEV6GyO.mjs +0 -573
- package/dist/provider-stream-COLujAAo-CbJPDngm.mjs +0 -35449
- package/dist/providers.runtime-Ba7tOlq7-CXkhkzU9.mjs +0 -219
- package/dist/public-surface-loader-BVl0NQAE-C0piXtsT.mjs +0 -117
- package/dist/resolve-C33B7eeu-BNvYTl6k.mjs +0 -1041
- package/dist/runtime-Cym-fqI8-DaSDMH-a.mjs +0 -120
- package/dist/runtime-channel-state-CohMybAh-hXR6y5Gx.mjs +0 -19
- package/dist/runtime-snapshot-C54O1-gI-40cbyi7P.mjs +0 -677
- package/dist/runtime-state-IBOIXKOx-Bf9tcLvc.mjs +0 -10
- package/dist/runtime-web-tools-fallback.runtime-Ca-qn1mj-BCVImm7a.mjs +0 -39
- package/dist/runtime-web-tools-manifest.runtime-BgxQTjmq-Cb4nJkRT.mjs +0 -2
- package/dist/runtime-web-tools-public-artifacts.runtime-D9qcoWIX-BrQdXzOQ.mjs +0 -2
- package/dist/session-archive.runtime-B52_5vs4-BG-_IwNJ.mjs +0 -2
- package/dist/session-key-Cn2QoOyX-CuHbJMgR.mjs +0 -82
- package/dist/session-transcript-files.fs-DEeFXruQ-B1PF6nLy.mjs +0 -147
- package/dist/src-BgCX0MLG.mjs +0 -813
- package/dist/src-DYbqlAqf.mjs +0 -1177
- package/dist/subagent-announce-L5WsQatW-CQWI9GMd.mjs +0 -344
- package/dist/subagent-announce.registry.runtime-DiqZyeTs-BKuniyi3.mjs +0 -28
- package/dist/subagent-registry-steer-runtime-DFgZFC0j-BhBz0roy.mjs +0 -211
- package/dist/subagent-system-prompt-C1qnN--K-DpnTFP47.mjs +0 -3061
- package/dist/target-parsing-loaded-DKkb6jJY-BMD4CkpS.mjs +0 -1002
- package/dist/task-registry-delivery-runtime-Dd1CUkZF-C8U40a3O.mjs +0 -2950
- package/dist/task-registry-delivery-runtime-ragbeVx5-CNbFAkjD.mjs +0 -2
- package/dist/thinking-Bh-7MqXz-D3woGbO7.mjs +0 -2
- package/dist/transcript-E_-ISOkD-DWCfZP2p.mjs +0 -2019
- package/dist/transcript.runtime-BqhvZZdl-BPy42vBP.mjs +0 -2
- package/dist/transform-messages-DbhIzTxq.mjs +0 -207
- package/dist/web-provider-public-artifacts-BlpRwIUS-CGPSV4W2.mjs +0 -295
- package/dist/web-search-providers.runtime--0aUtC3b-DyuhC95V.mjs +0 -200
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { a as resolveBundledWebFetchResolutionConfig, c as sortWebFetchProviders, i as mapRegistryProviders, s as resolveManifestDeclaredWebProviderCandidatePluginIds, t as resolveBundledWebFetchProvidersFromPublicArtifacts } from "./web-provider-public-artifacts-BlpRwIUS-CGPSV4W2.mjs";
|
|
2
|
-
import { n as createWebProviderSnapshotCache, r as resolvePluginWebProviders, t as resolvePluginWebSearchProviders } from "./web-search-providers.runtime--0aUtC3b-DyuhC95V.mjs";
|
|
3
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/web-fetch-providers.runtime-Bra-7YRJ.js
|
|
4
|
-
let webFetchProviderSnapshotCache = createWebProviderSnapshotCache();
|
|
5
|
-
function resolveWebFetchCandidatePluginIds(params) {
|
|
6
|
-
return resolveManifestDeclaredWebProviderCandidatePluginIds({
|
|
7
|
-
contract: "webFetchProviders",
|
|
8
|
-
configKey: "webFetch",
|
|
9
|
-
config: params.config,
|
|
10
|
-
workspaceDir: params.workspaceDir,
|
|
11
|
-
env: params.env,
|
|
12
|
-
onlyPluginIds: params.onlyPluginIds,
|
|
13
|
-
origin: params.origin
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
function mapRegistryWebFetchProviders(params) {
|
|
17
|
-
return mapRegistryProviders({
|
|
18
|
-
entries: params.registry.webFetchProviders,
|
|
19
|
-
onlyPluginIds: params.onlyPluginIds,
|
|
20
|
-
sortProviders: sortWebFetchProviders
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
function resolvePluginWebFetchProviders(params) {
|
|
24
|
-
return resolvePluginWebProviders(params, {
|
|
25
|
-
snapshotCache: webFetchProviderSnapshotCache,
|
|
26
|
-
resolveBundledResolutionConfig: resolveBundledWebFetchResolutionConfig,
|
|
27
|
-
resolveCandidatePluginIds: resolveWebFetchCandidatePluginIds,
|
|
28
|
-
mapRegistryProviders: mapRegistryWebFetchProviders,
|
|
29
|
-
resolveBundledPublicArtifactProviders: resolveBundledWebFetchProvidersFromPublicArtifacts
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/runtime-web-tools-fallback.runtime-Ca-qn1mj.js
|
|
34
|
-
const runtimeWebToolsFallbackProviders = {
|
|
35
|
-
resolvePluginWebFetchProviders,
|
|
36
|
-
resolvePluginWebSearchProviders
|
|
37
|
-
};
|
|
38
|
-
//#endregion
|
|
39
|
-
export { runtimeWebToolsFallbackProviders };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { c as resolveManifestContractOwnerPluginId, l as resolveManifestContractPluginIds, u as resolveManifestContractPluginIdsByCompatibilityRuntimePath } from "./manifest-registry-_hxKCS2K-CZdeyN0f.mjs";
|
|
2
|
-
export { resolveManifestContractOwnerPluginId, resolveManifestContractPluginIds, resolveManifestContractPluginIdsByCompatibilityRuntimePath };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { n as resolveBundledWebSearchProvidersFromPublicArtifacts, t as resolveBundledWebFetchProvidersFromPublicArtifacts } from "./web-provider-public-artifacts-BlpRwIUS-CGPSV4W2.mjs";
|
|
2
|
-
export { resolveBundledWebFetchProvidersFromPublicArtifacts, resolveBundledWebSearchProvidersFromPublicArtifacts };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { i as resolveStableSessionEndTranscript, n as archiveSessionTranscriptsDetailed, r as cleanupArchivedSessionTranscripts, t as archiveSessionTranscripts } from "./session-transcript-files.fs-DEeFXruQ-B1PF6nLy.mjs";
|
|
2
|
-
export { archiveSessionTranscripts, archiveSessionTranscriptsDetailed, cleanupArchivedSessionTranscripts, resolveStableSessionEndTranscript };
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { c as normalizeOptionalString, o as normalizeLowercaseStringOrEmpty, s as normalizeOptionalLowercaseString } from "./home-dir-C44RaPME-CBRS4HLP.mjs";
|
|
2
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/session-key-Cn2QoOyX.js
|
|
3
|
-
/**
|
|
4
|
-
* Parse agent-scoped session keys in a canonical, case-insensitive way.
|
|
5
|
-
* Returned values are normalized to lowercase for stable comparisons/routing.
|
|
6
|
-
*/
|
|
7
|
-
function parseAgentSessionKey(sessionKey) {
|
|
8
|
-
const raw = normalizeOptionalLowercaseString(sessionKey);
|
|
9
|
-
if (!raw) return null;
|
|
10
|
-
const parts = raw.split(":").filter(Boolean);
|
|
11
|
-
if (parts.length < 3) return null;
|
|
12
|
-
if (parts[0] !== "agent") return null;
|
|
13
|
-
const agentId = normalizeOptionalString(parts[1]);
|
|
14
|
-
const rest = parts.slice(2).join(":");
|
|
15
|
-
if (!agentId || !rest) return null;
|
|
16
|
-
return {
|
|
17
|
-
agentId,
|
|
18
|
-
rest
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function isCronSessionKey(sessionKey) {
|
|
22
|
-
const parsed = parseAgentSessionKey(sessionKey);
|
|
23
|
-
if (!parsed) return false;
|
|
24
|
-
return normalizeOptionalLowercaseString(parsed.rest)?.startsWith("cron:") === true;
|
|
25
|
-
}
|
|
26
|
-
function getSubagentDepth(sessionKey) {
|
|
27
|
-
const raw = normalizeOptionalLowercaseString(sessionKey);
|
|
28
|
-
if (!raw) return 0;
|
|
29
|
-
return raw.split(":subagent:").length - 1;
|
|
30
|
-
}
|
|
31
|
-
function parseThreadSessionSuffix(sessionKey) {
|
|
32
|
-
const raw = normalizeOptionalString(sessionKey);
|
|
33
|
-
if (!raw) return {
|
|
34
|
-
baseSessionKey: void 0,
|
|
35
|
-
threadId: void 0
|
|
36
|
-
};
|
|
37
|
-
const markerIndex = normalizeLowercaseStringOrEmpty(raw).lastIndexOf(":thread:");
|
|
38
|
-
return {
|
|
39
|
-
baseSessionKey: markerIndex === -1 ? raw : raw.slice(0, markerIndex),
|
|
40
|
-
threadId: normalizeOptionalString(markerIndex === -1 ? void 0 : raw.slice(markerIndex + 8))
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function parseRawSessionConversationRef(sessionKey) {
|
|
44
|
-
const raw = normalizeOptionalString(sessionKey);
|
|
45
|
-
if (!raw) return null;
|
|
46
|
-
const rawParts = raw.split(":").filter(Boolean);
|
|
47
|
-
const bodyStartIndex = rawParts.length >= 3 && normalizeOptionalLowercaseString(rawParts[0]) === "agent" ? 2 : 0;
|
|
48
|
-
const parts = rawParts.slice(bodyStartIndex);
|
|
49
|
-
if (parts.length < 3) return null;
|
|
50
|
-
const channel = normalizeOptionalLowercaseString(parts[0]);
|
|
51
|
-
const kind = normalizeOptionalLowercaseString(parts[1]);
|
|
52
|
-
if (!channel || kind !== "group" && kind !== "channel") return null;
|
|
53
|
-
const rawId = normalizeOptionalString(parts.slice(2).join(":"));
|
|
54
|
-
const prefix = normalizeOptionalString(rawParts.slice(0, bodyStartIndex + 2).join(":"));
|
|
55
|
-
if (!rawId || !prefix) return null;
|
|
56
|
-
return {
|
|
57
|
-
channel,
|
|
58
|
-
kind,
|
|
59
|
-
rawId,
|
|
60
|
-
prefix
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
const DEFAULT_AGENT_ID = "main";
|
|
64
|
-
const VALID_ID_RE = /^[a-z0-9][a-z0-9_-]{0,63}$/i;
|
|
65
|
-
const INVALID_CHARS_RE = /[^a-z0-9_-]+/g;
|
|
66
|
-
const LEADING_DASH_RE = /^-+/;
|
|
67
|
-
const TRAILING_DASH_RE = /-+$/;
|
|
68
|
-
function normalizeMainKey(value) {
|
|
69
|
-
return normalizeLowercaseStringOrEmpty(value) || "main";
|
|
70
|
-
}
|
|
71
|
-
function resolveAgentIdFromSessionKey(sessionKey) {
|
|
72
|
-
return normalizeAgentId(parseAgentSessionKey(sessionKey)?.agentId ?? "main");
|
|
73
|
-
}
|
|
74
|
-
function normalizeAgentId(value) {
|
|
75
|
-
const trimmed = (value ?? "").trim();
|
|
76
|
-
if (!trimmed) return DEFAULT_AGENT_ID;
|
|
77
|
-
const normalized = normalizeLowercaseStringOrEmpty(trimmed);
|
|
78
|
-
if (VALID_ID_RE.test(trimmed)) return normalized;
|
|
79
|
-
return normalized.replace(INVALID_CHARS_RE, "-").replace(LEADING_DASH_RE, "").replace(TRAILING_DASH_RE, "").slice(0, 64) || "main";
|
|
80
|
-
}
|
|
81
|
-
//#endregion
|
|
82
|
-
export { normalizeMainKey as a, parseThreadSessionSuffix as c, normalizeAgentId as i, resolveAgentIdFromSessionKey as l, getSubagentDepth as n, parseAgentSessionKey as o, isCronSessionKey as r, parseRawSessionConversationRef as s, DEFAULT_AGENT_ID as t };
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { i as resolveRequiredHomeDir } from "./home-dir-C44RaPME-CBRS4HLP.mjs";
|
|
2
|
-
import { i as resolveSessionTranscriptPathInDir, l as parseSessionArchiveTimestamp, n as resolveSessionFilePath, o as formatSessionArchiveTimestamp, r as resolveSessionTranscriptPath } from "./paths-D6msg0S1-C2lYuisN.mjs";
|
|
3
|
-
import fs from "node:fs";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import os from "node:os";
|
|
6
|
-
//#region node_modules/.pnpm/openclaw@2026.4.22_@napi-rs+canvas@0.1.99/node_modules/openclaw/dist/session-transcript-files.fs-DEeFXruQ.js
|
|
7
|
-
function classifySessionTranscriptCandidate(sessionId, sessionFile) {
|
|
8
|
-
const transcriptSessionId = extractGeneratedTranscriptSessionId(sessionFile);
|
|
9
|
-
if (!transcriptSessionId) return "custom";
|
|
10
|
-
return transcriptSessionId === sessionId ? "current" : "stale";
|
|
11
|
-
}
|
|
12
|
-
function extractGeneratedTranscriptSessionId(sessionFile) {
|
|
13
|
-
const trimmed = sessionFile?.trim();
|
|
14
|
-
if (!trimmed) return;
|
|
15
|
-
const base = path.basename(trimmed);
|
|
16
|
-
if (!base.endsWith(".jsonl")) return;
|
|
17
|
-
const withoutExt = base.slice(0, -6);
|
|
18
|
-
const topicIndex = withoutExt.indexOf("-topic-");
|
|
19
|
-
if (topicIndex > 0) {
|
|
20
|
-
const topicSessionId = withoutExt.slice(0, topicIndex);
|
|
21
|
-
return looksLikeGeneratedSessionId(topicSessionId) ? topicSessionId : void 0;
|
|
22
|
-
}
|
|
23
|
-
const forkMatch = withoutExt.match(/^(\d{4}-\d{2}-\d{2}T[\w-]+(?:Z|[+-]\d{2}(?:-\d{2})?)?)_(.+)$/);
|
|
24
|
-
if (forkMatch?.[2]) return looksLikeGeneratedSessionId(forkMatch[2]) ? forkMatch[2] : void 0;
|
|
25
|
-
return looksLikeGeneratedSessionId(withoutExt) ? withoutExt : void 0;
|
|
26
|
-
}
|
|
27
|
-
function looksLikeGeneratedSessionId(value) {
|
|
28
|
-
return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);
|
|
29
|
-
}
|
|
30
|
-
function canonicalizePathForComparison(filePath) {
|
|
31
|
-
const resolved = path.resolve(filePath);
|
|
32
|
-
try {
|
|
33
|
-
return fs.realpathSync(resolved);
|
|
34
|
-
} catch {
|
|
35
|
-
return resolved;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function resolveSessionTranscriptCandidates(sessionId, storePath, sessionFile, agentId) {
|
|
39
|
-
const candidates = [];
|
|
40
|
-
const sessionFileState = classifySessionTranscriptCandidate(sessionId, sessionFile);
|
|
41
|
-
const pushCandidate = (resolve) => {
|
|
42
|
-
try {
|
|
43
|
-
candidates.push(resolve());
|
|
44
|
-
} catch {}
|
|
45
|
-
};
|
|
46
|
-
if (storePath) {
|
|
47
|
-
const sessionsDir = path.dirname(storePath);
|
|
48
|
-
if (sessionFile && sessionFileState !== "stale") pushCandidate(() => resolveSessionFilePath(sessionId, { sessionFile }, {
|
|
49
|
-
sessionsDir,
|
|
50
|
-
agentId
|
|
51
|
-
}));
|
|
52
|
-
pushCandidate(() => resolveSessionTranscriptPathInDir(sessionId, sessionsDir));
|
|
53
|
-
if (sessionFile && sessionFileState === "stale") pushCandidate(() => resolveSessionFilePath(sessionId, { sessionFile }, {
|
|
54
|
-
sessionsDir,
|
|
55
|
-
agentId
|
|
56
|
-
}));
|
|
57
|
-
} else if (sessionFile) if (agentId) {
|
|
58
|
-
if (sessionFileState !== "stale") pushCandidate(() => resolveSessionFilePath(sessionId, { sessionFile }, { agentId }));
|
|
59
|
-
} else {
|
|
60
|
-
const trimmed = sessionFile.trim();
|
|
61
|
-
if (trimmed) candidates.push(path.resolve(trimmed));
|
|
62
|
-
}
|
|
63
|
-
if (agentId) {
|
|
64
|
-
pushCandidate(() => resolveSessionTranscriptPath(sessionId, agentId));
|
|
65
|
-
if (sessionFile && sessionFileState === "stale") pushCandidate(() => resolveSessionFilePath(sessionId, { sessionFile }, { agentId }));
|
|
66
|
-
}
|
|
67
|
-
const home = resolveRequiredHomeDir(process.env, os.homedir);
|
|
68
|
-
const legacyDir = path.join(home, ".openclaw", "sessions");
|
|
69
|
-
pushCandidate(() => resolveSessionTranscriptPathInDir(sessionId, legacyDir));
|
|
70
|
-
return Array.from(new Set(candidates));
|
|
71
|
-
}
|
|
72
|
-
function archiveFileOnDisk(filePath, reason) {
|
|
73
|
-
const archived = `${filePath}.${reason}.${formatSessionArchiveTimestamp()}`;
|
|
74
|
-
fs.renameSync(filePath, archived);
|
|
75
|
-
return archived;
|
|
76
|
-
}
|
|
77
|
-
function archiveSessionTranscripts(opts) {
|
|
78
|
-
return archiveSessionTranscriptsDetailed(opts).map((entry) => entry.archivedPath);
|
|
79
|
-
}
|
|
80
|
-
function archiveSessionTranscriptsDetailed(opts) {
|
|
81
|
-
const archived = [];
|
|
82
|
-
const storeDir = opts.restrictToStoreDir && opts.storePath ? canonicalizePathForComparison(path.dirname(opts.storePath)) : null;
|
|
83
|
-
for (const candidate of resolveSessionTranscriptCandidates(opts.sessionId, opts.storePath, opts.sessionFile, opts.agentId)) {
|
|
84
|
-
const candidatePath = canonicalizePathForComparison(candidate);
|
|
85
|
-
if (storeDir) {
|
|
86
|
-
const relative = path.relative(storeDir, candidatePath);
|
|
87
|
-
if (!relative || relative.startsWith("..") || path.isAbsolute(relative)) continue;
|
|
88
|
-
}
|
|
89
|
-
if (!fs.existsSync(candidatePath)) continue;
|
|
90
|
-
try {
|
|
91
|
-
archived.push({
|
|
92
|
-
sourcePath: candidatePath,
|
|
93
|
-
archivedPath: archiveFileOnDisk(candidatePath, opts.reason)
|
|
94
|
-
});
|
|
95
|
-
} catch {}
|
|
96
|
-
}
|
|
97
|
-
return archived;
|
|
98
|
-
}
|
|
99
|
-
function resolveStableSessionEndTranscript(params) {
|
|
100
|
-
const archivedTranscripts = params.archivedTranscripts ?? [];
|
|
101
|
-
if (archivedTranscripts.length > 0) {
|
|
102
|
-
const preferredPath = params.sessionFile?.trim() ? canonicalizePathForComparison(params.sessionFile) : void 0;
|
|
103
|
-
const archivedPath = (preferredPath == null ? void 0 : archivedTranscripts.find((entry) => canonicalizePathForComparison(entry.sourcePath) === preferredPath))?.archivedPath ?? archivedTranscripts[0]?.archivedPath;
|
|
104
|
-
if (archivedPath) return {
|
|
105
|
-
sessionFile: archivedPath,
|
|
106
|
-
transcriptArchived: true
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
for (const candidate of resolveSessionTranscriptCandidates(params.sessionId, params.storePath, params.sessionFile, params.agentId)) {
|
|
110
|
-
const candidatePath = canonicalizePathForComparison(candidate);
|
|
111
|
-
if (fs.existsSync(candidatePath)) return {
|
|
112
|
-
sessionFile: candidatePath,
|
|
113
|
-
transcriptArchived: false
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
return {};
|
|
117
|
-
}
|
|
118
|
-
async function cleanupArchivedSessionTranscripts(opts) {
|
|
119
|
-
if (!Number.isFinite(opts.olderThanMs) || opts.olderThanMs < 0) return {
|
|
120
|
-
removed: 0,
|
|
121
|
-
scanned: 0
|
|
122
|
-
};
|
|
123
|
-
const now = opts.nowMs ?? Date.now();
|
|
124
|
-
const reason = opts.reason ?? "deleted";
|
|
125
|
-
const directories = Array.from(new Set(opts.directories.map((dir) => path.resolve(dir))));
|
|
126
|
-
let removed = 0;
|
|
127
|
-
let scanned = 0;
|
|
128
|
-
for (const dir of directories) {
|
|
129
|
-
const entries = await fs.promises.readdir(dir).catch(() => []);
|
|
130
|
-
for (const entry of entries) {
|
|
131
|
-
const timestamp = parseSessionArchiveTimestamp(entry, reason);
|
|
132
|
-
if (timestamp == null) continue;
|
|
133
|
-
scanned += 1;
|
|
134
|
-
if (now - timestamp <= opts.olderThanMs) continue;
|
|
135
|
-
const fullPath = path.join(dir, entry);
|
|
136
|
-
if (!(await fs.promises.stat(fullPath).catch(() => null))?.isFile()) continue;
|
|
137
|
-
await fs.promises.rm(fullPath).catch(() => void 0);
|
|
138
|
-
removed += 1;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return {
|
|
142
|
-
removed,
|
|
143
|
-
scanned
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
//#endregion
|
|
147
|
-
export { resolveStableSessionEndTranscript as i, archiveSessionTranscriptsDetailed as n, cleanupArchivedSessionTranscripts as r, archiveSessionTranscripts as t };
|