@talex-touch/utils 1.0.44 → 1.0.45
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/.eslintcache +1 -1
- package/common/utils/safe-shell.ts +4 -4
- package/package.json +1 -1
- package/transport/events/index.ts +21 -1
- package/transport/events/types/app-index.ts +11 -0
- package/transport/events/types/file-index.ts +11 -0
- package/transport/events/types/plugin.ts +11 -0
- package/transport/index.ts +2 -0
- package/transport/prelude.ts +208 -0
- package/transport/sdk/domains/settings.ts +11 -1
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/__tests__/transport-domain-sdks.test.ts":"1","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/cloud-sync/cloud-sync-sdk.ts":"2","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/index.ts":"3","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/safe-path.ts":"4","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/safe-shell.ts":"5","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/electron/env-tool.ts":"6","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/i18n/message-keys.ts":"7","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/permission/index.ts":"8","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/permission/registry.ts":"9","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/permission/types.ts":"10","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/cloud-sync.ts":"11","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/renderer/storage/base-storage.ts":"12","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/renderer/storage/intelligence-storage.ts":"13","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/sdk/domains/intelligence.ts":"14","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/cloud-sync.ts":"15","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/intelligence.ts":"16","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/update.ts":"17","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/flow.ts":"18","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/core-box/recommendation.ts":"19","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/index.ts":"20","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/recommend.ts":"21","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/types.ts":"22","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/polling.ts":"23","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/index.ts":"24","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/file-index.ts":"25","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/sdk/domains/settings.ts":"26","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/intelligence/client.ts":"27","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/index.ts":"28","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/index.ts":"29","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/path-browserify.d.ts":"30","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/core-box.ts":"31"},{"size":5306,"mtime":1771563102452,"results":"32","hashOfConfig":"33"},{"size":15379,"mtime":1771563102455,"results":"34","hashOfConfig":"33"},{"size":5659,"mtime":1771563102455,"results":"35","hashOfConfig":"33"},{"size":2691,"mtime":1771563102456,"results":"36","hashOfConfig":"33"},{"size":2879,"mtime":1771563102456,"results":"37","hashOfConfig":"33"},{"size":2472,"mtime":1771563102458,"results":"38","hashOfConfig":"33"},{"size":7760,"mtime":1771563102481,"results":"39","hashOfConfig":"33"},{"size":4206,"mtime":1771563102484,"results":"40","hashOfConfig":"33"},{"size":7775,"mtime":1771563102484,"results":"41","hashOfConfig":"33"},{"size":3423,"mtime":1771563102493,"results":"42","hashOfConfig":"33"},{"size":3750,"mtime":1771563102509,"results":"43","hashOfConfig":"33"},{"size":26935,"mtime":1771563102511,"results":"44","hashOfConfig":"33"},{"size":6457,"mtime":1771563102514,"results":"45","hashOfConfig":"33"},{"size":21154,"mtime":1771563102519,"results":"46","hashOfConfig":"33"},{"size":3091,"mtime":1771563102519,"results":"47","hashOfConfig":"33"},{"size":55314,"mtime":1771563102519,"results":"48","hashOfConfig":"33"},{"size":6327,"mtime":1771566199653,"results":"49","hashOfConfig":"50"},{"size":2888,"mtime":1771563689317,"results":"51","hashOfConfig":"33"},{"size":3003,"mtime":1771611450129,"results":"52","hashOfConfig":"50"},{"size":986,"mtime":1771611509397,"results":"53","hashOfConfig":"50"},{"size":683,"mtime":1771611477506,"results":"54","hashOfConfig":"50"},{"size":26106,"mtime":1771611536284,"results":"55","hashOfConfig":"50"},{"size":11083,"mtime":1771632074503,"results":"56","hashOfConfig":"50"},{"size":74191,"mtime":1771632883663,"results":"57","hashOfConfig":"50"},{"size":1560,"mtime":1771632863820,"results":"58","hashOfConfig":"50"},{"size":4093,"mtime":1771632913471,"results":"59","hashOfConfig":"50"},{"size":3327,"mtime":1771678966584,"results":"60","hashOfConfig":"50"},{"size":18271,"mtime":1771679568421,"results":"61","hashOfConfig":"50"},{"size":329,"mtime":1771678957747,"results":"62","hashOfConfig":"50"},{"size":135,"mtime":1771678957747,"results":"63","hashOfConfig":"64"},{"size":9317,"mtime":1771684543626,"results":"65","hashOfConfig":"50"},{"filePath":"66","messages":"67","suppressedMessages":"68","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"tyugd7",{"filePath":"69","messages":"70","suppressedMessages":"71","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"72","messages":"73","suppressedMessages":"74","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"75","messages":"76","suppressedMessages":"77","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"78","messages":"79","suppressedMessages":"80","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"81","messages":"82","suppressedMessages":"83","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"84","messages":"85","suppressedMessages":"86","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"87","messages":"88","suppressedMessages":"89","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"90","messages":"91","suppressedMessages":"92","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"93","messages":"94","suppressedMessages":"95","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"96","messages":"97","suppressedMessages":"98","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"99","messages":"100","suppressedMessages":"101","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"102","messages":"103","suppressedMessages":"104","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"105","messages":"106","suppressedMessages":"107","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"108","messages":"109","suppressedMessages":"110","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"111","messages":"112","suppressedMessages":"113","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"114","messages":"115","suppressedMessages":"116","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"m7p77f",{"filePath":"117","messages":"118","suppressedMessages":"119","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","suppressedMessages":"122","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"123","messages":"124","suppressedMessages":"125","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","suppressedMessages":"128","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"129","messages":"130","suppressedMessages":"131","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","suppressedMessages":"134","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"135","messages":"136","suppressedMessages":"137","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","suppressedMessages":"140","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"141","messages":"142","suppressedMessages":"143","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"144","messages":"145","suppressedMessages":"146","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"147","messages":"148","suppressedMessages":"149","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"150","messages":"151","suppressedMessages":"152","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"153","messages":"154","suppressedMessages":"155","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"552fw",{"filePath":"156","messages":"157","suppressedMessages":"158","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/__tests__/transport-domain-sdks.test.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/cloud-sync/cloud-sync-sdk.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/safe-path.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/safe-shell.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/electron/env-tool.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/i18n/message-keys.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/permission/index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/permission/registry.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/permission/types.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/cloud-sync.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/renderer/storage/base-storage.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/renderer/storage/intelligence-storage.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/sdk/domains/intelligence.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/cloud-sync.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/intelligence.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/update.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/flow.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/core-box/recommendation.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/recommend.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/types.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/polling.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/file-index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/sdk/domains/settings.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/intelligence/client.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/path-browserify.d.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/core-box.ts",[],[]]
|
|
1
|
+
[{"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/__tests__/transport-domain-sdks.test.ts":"1","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/cloud-sync/cloud-sync-sdk.ts":"2","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/index.ts":"3","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/safe-path.ts":"4","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/safe-shell.ts":"5","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/electron/env-tool.ts":"6","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/i18n/message-keys.ts":"7","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/permission/index.ts":"8","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/permission/registry.ts":"9","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/permission/types.ts":"10","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/cloud-sync.ts":"11","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/renderer/storage/base-storage.ts":"12","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/renderer/storage/intelligence-storage.ts":"13","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/sdk/domains/intelligence.ts":"14","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/cloud-sync.ts":"15","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/intelligence.ts":"16","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/update.ts":"17","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/flow.ts":"18","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/core-box/recommendation.ts":"19","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/index.ts":"20","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/recommend.ts":"21","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/types.ts":"22","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/polling.ts":"23","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/index.ts":"24","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/file-index.ts":"25","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/sdk/domains/settings.ts":"26","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/intelligence/client.ts":"27","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/index.ts":"28","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/index.ts":"29","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/path-browserify.d.ts":"30","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/core-box.ts":"31","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/app-index.ts":"32","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/index.ts":"33","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/prelude.ts":"34","/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/plugin.ts":"35"},{"size":5306,"mtime":1771563102452,"results":"36","hashOfConfig":"37"},{"size":15379,"mtime":1771563102455,"results":"38","hashOfConfig":"37"},{"size":5659,"mtime":1771563102455,"results":"39","hashOfConfig":"37"},{"size":2691,"mtime":1771563102456,"results":"40","hashOfConfig":"37"},{"size":2710,"mtime":1771755191828,"results":"41","hashOfConfig":"42"},{"size":2472,"mtime":1771563102458,"results":"43","hashOfConfig":"37"},{"size":7760,"mtime":1771563102481,"results":"44","hashOfConfig":"37"},{"size":4206,"mtime":1771563102484,"results":"45","hashOfConfig":"37"},{"size":7775,"mtime":1771563102484,"results":"46","hashOfConfig":"37"},{"size":3423,"mtime":1771563102493,"results":"47","hashOfConfig":"37"},{"size":3750,"mtime":1771563102509,"results":"48","hashOfConfig":"37"},{"size":26935,"mtime":1771563102511,"results":"49","hashOfConfig":"37"},{"size":6457,"mtime":1771563102514,"results":"50","hashOfConfig":"37"},{"size":21154,"mtime":1771563102519,"results":"51","hashOfConfig":"37"},{"size":3091,"mtime":1771563102519,"results":"52","hashOfConfig":"37"},{"size":55314,"mtime":1771563102519,"results":"53","hashOfConfig":"37"},{"size":6327,"mtime":1771566199653,"results":"54","hashOfConfig":"42"},{"size":2888,"mtime":1771563689317,"results":"55","hashOfConfig":"37"},{"size":3003,"mtime":1771611450129,"results":"56","hashOfConfig":"42"},{"size":986,"mtime":1771611509397,"results":"57","hashOfConfig":"42"},{"size":683,"mtime":1771611477506,"results":"58","hashOfConfig":"42"},{"size":26106,"mtime":1771611536284,"results":"59","hashOfConfig":"42"},{"size":11083,"mtime":1771632074503,"results":"60","hashOfConfig":"42"},{"size":74847,"mtime":1771749468590,"results":"61","hashOfConfig":"42"},{"size":1770,"mtime":1771710444200,"results":"62","hashOfConfig":"42"},{"size":4523,"mtime":1771710495855,"results":"63","hashOfConfig":"42"},{"size":3327,"mtime":1771678966584,"results":"64","hashOfConfig":"42"},{"size":18271,"mtime":1771679568421,"results":"65","hashOfConfig":"42"},{"size":329,"mtime":1771678957747,"results":"66","hashOfConfig":"42"},{"size":135,"mtime":1771678957747,"results":"67","hashOfConfig":"68"},{"size":9317,"mtime":1771684543626,"results":"69","hashOfConfig":"42"},{"size":478,"mtime":1771710451259,"results":"70","hashOfConfig":"42"},{"size":3533,"mtime":1771739652939,"results":"71","hashOfConfig":"42"},{"size":6426,"mtime":1771739449023,"results":"72","hashOfConfig":"42"},{"size":11904,"mtime":1771750097131,"results":"73","hashOfConfig":"42"},{"filePath":"74","messages":"75","suppressedMessages":"76","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"tyugd7",{"filePath":"77","messages":"78","suppressedMessages":"79","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"80","messages":"81","suppressedMessages":"82","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"83","messages":"84","suppressedMessages":"85","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"86","messages":"87","suppressedMessages":"88","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"m7p77f",{"filePath":"89","messages":"90","suppressedMessages":"91","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"92","messages":"93","suppressedMessages":"94","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"95","messages":"96","suppressedMessages":"97","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"98","messages":"99","suppressedMessages":"100","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"101","messages":"102","suppressedMessages":"103","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"104","messages":"105","suppressedMessages":"106","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"107","messages":"108","suppressedMessages":"109","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"110","messages":"111","suppressedMessages":"112","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"113","messages":"114","suppressedMessages":"115","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"116","messages":"117","suppressedMessages":"118","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"119","messages":"120","suppressedMessages":"121","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"122","messages":"123","suppressedMessages":"124","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"125","messages":"126","suppressedMessages":"127","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"128","messages":"129","suppressedMessages":"130","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"131","messages":"132","suppressedMessages":"133","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"134","messages":"135","suppressedMessages":"136","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"137","messages":"138","suppressedMessages":"139","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"140","messages":"141","suppressedMessages":"142","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"143","messages":"144","suppressedMessages":"145","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"146","messages":"147","suppressedMessages":"148","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"149","messages":"150","suppressedMessages":"151","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"152","messages":"153","suppressedMessages":"154","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"155","messages":"156","suppressedMessages":"157","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"158","messages":"159","suppressedMessages":"160","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"161","messages":"162","suppressedMessages":"163","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"552fw",{"filePath":"164","messages":"165","suppressedMessages":"166","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"167","messages":"168","suppressedMessages":"169","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"170","messages":"171","suppressedMessages":"172","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"173","messages":"174","suppressedMessages":"175","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"176","messages":"177","suppressedMessages":"178","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/__tests__/transport-domain-sdks.test.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/cloud-sync/cloud-sync-sdk.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/safe-path.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/safe-shell.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/electron/env-tool.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/i18n/message-keys.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/permission/index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/permission/registry.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/permission/types.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/cloud-sync.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/renderer/storage/base-storage.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/renderer/storage/intelligence-storage.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/sdk/domains/intelligence.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/cloud-sync.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/intelligence.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/update.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/flow.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/core-box/recommendation.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/recommend.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/sdk/types.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/common/utils/polling.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/file-index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/sdk/domains/settings.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/intelligence/client.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/plugin/index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/types/path-browserify.d.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/core-box.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/app-index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/index.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/prelude.ts",[],[],"/Users/talexdreamsoul/Workspace/Projects/talex-touch/packages/utils/transport/events/types/plugin.ts",[],[]]
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ChildProcess,
|
|
3
|
-
ExecException,
|
|
4
3
|
ExecFileOptions,
|
|
5
4
|
SpawnOptionsWithoutStdio,
|
|
6
5
|
} from 'node:child_process'
|
|
7
6
|
import { hasWindow } from '../../env'
|
|
8
7
|
|
|
9
|
-
type
|
|
8
|
+
type ExecFileFn = typeof import('node:child_process').execFile
|
|
9
|
+
type SpawnFn = typeof import('node:child_process').spawn
|
|
10
10
|
|
|
11
11
|
const NULL_BYTE_PATTERN = /\0/
|
|
12
12
|
const NEWLINE_PATTERN = /[\r\n]/
|
|
@@ -53,8 +53,8 @@ function assertShellArg(value: string): string {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
function requireChildProcess(): {
|
|
56
|
-
execFile:
|
|
57
|
-
spawn:
|
|
56
|
+
execFile: ExecFileFn
|
|
57
|
+
spawn: SpawnFn
|
|
58
58
|
} {
|
|
59
59
|
if (!execFileImpl || !spawnImpl) {
|
|
60
60
|
throw new Error('CHILD_PROCESS_UNAVAILABLE')
|
package/package.json
CHANGED
|
@@ -100,7 +100,7 @@ import type {
|
|
|
100
100
|
TrackEventPayload,
|
|
101
101
|
} from './types/app'
|
|
102
102
|
|
|
103
|
-
import type { AppIndexSettings } from './types/app-index'
|
|
103
|
+
import type { AppIndexAddPathRequest, AppIndexAddPathResult, AppIndexSettings } from './types/app-index'
|
|
104
104
|
|
|
105
105
|
// ============================================================================
|
|
106
106
|
// App Events
|
|
@@ -244,6 +244,8 @@ import type {
|
|
|
244
244
|
// ============================================================================
|
|
245
245
|
|
|
246
246
|
import type {
|
|
247
|
+
FileIndexAddPathRequest,
|
|
248
|
+
FileIndexAddPathResult,
|
|
247
249
|
FileIndexBatteryStatus,
|
|
248
250
|
FileIndexFailedFile,
|
|
249
251
|
FileIndexProgress,
|
|
@@ -395,6 +397,7 @@ import type {
|
|
|
395
397
|
PluginInfo,
|
|
396
398
|
PluginInstallConfirmPayload,
|
|
397
399
|
PluginInstallConfirmResponsePayload,
|
|
400
|
+
PluginInstallCompletedPayload,
|
|
398
401
|
PluginInstallProgressPayload,
|
|
399
402
|
PluginInstallSourceRequest,
|
|
400
403
|
PluginInstallSourceResponse,
|
|
@@ -777,6 +780,14 @@ export const AppEvents = {
|
|
|
777
780
|
.module('file-index')
|
|
778
781
|
.event('failed-files')
|
|
779
782
|
.define<void, FileIndexFailedFile[]>(),
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Add a path to file index watch list.
|
|
786
|
+
*/
|
|
787
|
+
addPath: defineEvent('app')
|
|
788
|
+
.module('file-index')
|
|
789
|
+
.event('add-path')
|
|
790
|
+
.define<FileIndexAddPathRequest, FileIndexAddPathResult>(),
|
|
780
791
|
},
|
|
781
792
|
|
|
782
793
|
/**
|
|
@@ -819,6 +830,14 @@ export const AppEvents = {
|
|
|
819
830
|
.module('app-index')
|
|
820
831
|
.event('settings.update')
|
|
821
832
|
.define<Partial<AppIndexSettings>, AppIndexSettings>(),
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Add an application path to the index list.
|
|
836
|
+
*/
|
|
837
|
+
addPath: defineEvent('app')
|
|
838
|
+
.module('app-index')
|
|
839
|
+
.event('add-path')
|
|
840
|
+
.define<AppIndexAddPathRequest, AppIndexAddPathResult>(),
|
|
822
841
|
},
|
|
823
842
|
|
|
824
843
|
/**
|
|
@@ -2020,6 +2039,7 @@ export const PluginEvents = {
|
|
|
2020
2039
|
confirm: defineRawEvent<PluginInstallConfirmPayload, void>('plugin:install-confirm'),
|
|
2021
2040
|
confirmResponse: defineRawEvent<PluginInstallConfirmResponsePayload, void>('plugin:install-confirm-response'),
|
|
2022
2041
|
source: defineRawEvent<PluginInstallSourceRequest, PluginInstallSourceResponse>('plugin:install-source'),
|
|
2042
|
+
completed: defineRawEvent<PluginInstallCompletedPayload, void>('plugin:install-completed'),
|
|
2023
2043
|
},
|
|
2024
2044
|
|
|
2025
2045
|
devServer: {
|
|
@@ -7,3 +7,14 @@ export interface AppIndexSettings {
|
|
|
7
7
|
fullSyncIntervalMs: number
|
|
8
8
|
fullSyncCheckIntervalMs: number
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
export interface AppIndexAddPathRequest {
|
|
12
|
+
path: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface AppIndexAddPathResult {
|
|
16
|
+
success: boolean
|
|
17
|
+
status: 'added' | 'updated' | 'invalid' | 'error'
|
|
18
|
+
path?: string
|
|
19
|
+
reason?: string
|
|
20
|
+
}
|
|
@@ -46,6 +46,17 @@ export interface FileIndexStats {
|
|
|
46
46
|
embeddingRows: number
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
export interface FileIndexAddPathRequest {
|
|
50
|
+
path: string
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface FileIndexAddPathResult {
|
|
54
|
+
success: boolean
|
|
55
|
+
status: 'added' | 'exists' | 'invalid' | 'error'
|
|
56
|
+
path?: string
|
|
57
|
+
reason?: string
|
|
58
|
+
}
|
|
59
|
+
|
|
49
60
|
export interface FileIndexRebuildRequest {
|
|
50
61
|
force?: boolean
|
|
51
62
|
}
|
|
@@ -161,6 +161,17 @@ export interface PluginInfo {
|
|
|
161
161
|
error?: string
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
+
export type PluginInstallSource = 'dev' | 'tpex'
|
|
165
|
+
|
|
166
|
+
export type PluginInstallStatus = 'success' | 'exists' | 'error'
|
|
167
|
+
|
|
168
|
+
export interface PluginInstallCompletedPayload {
|
|
169
|
+
name?: string
|
|
170
|
+
source: PluginInstallSource
|
|
171
|
+
status: PluginInstallStatus
|
|
172
|
+
error?: string
|
|
173
|
+
}
|
|
174
|
+
|
|
164
175
|
// ============================================================================
|
|
165
176
|
// Feature Types
|
|
166
177
|
// ============================================================================
|
package/transport/index.ts
CHANGED
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { DataCode } from '../channel'
|
|
2
|
+
|
|
3
|
+
type PluginChannelPreludeOptions = {
|
|
4
|
+
uniqueKey: string
|
|
5
|
+
initialData?: Record<string, unknown>
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function getPluginChannelPreludeCode(options: PluginChannelPreludeOptions): string {
|
|
9
|
+
const initialData = options.initialData ?? {}
|
|
10
|
+
|
|
11
|
+
return `
|
|
12
|
+
(function() {
|
|
13
|
+
const uniqueKey = ${JSON.stringify(options.uniqueKey)};
|
|
14
|
+
window['$tuffInitialData'] = ${JSON.stringify(initialData)};
|
|
15
|
+
const { ipcRenderer } = require('electron');
|
|
16
|
+
const DataCode = ${JSON.stringify(DataCode)};
|
|
17
|
+
const CHANNEL_DEFAULT_TIMEOUT = 60000;
|
|
18
|
+
|
|
19
|
+
class TouchChannel {
|
|
20
|
+
channelMap = new Map();
|
|
21
|
+
pendingMap = new Map();
|
|
22
|
+
earlyMessageQueue = new Map();
|
|
23
|
+
|
|
24
|
+
constructor() {
|
|
25
|
+
ipcRenderer.on('@plugin-process-message', this.__handle_main.bind(this));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
__parse_raw_data(e, arg) {
|
|
29
|
+
if (arg) {
|
|
30
|
+
const { name, header, code, plugin, data, sync } = arg;
|
|
31
|
+
if (header) {
|
|
32
|
+
const { uniqueKey: thisUniqueKey } = header;
|
|
33
|
+
if (!thisUniqueKey) {
|
|
34
|
+
console.warn('[Plugin] uniqueKey missing in header:', arg);
|
|
35
|
+
} else if (thisUniqueKey !== uniqueKey) {
|
|
36
|
+
console.error('[Plugin] uniqueKey mismatch:', thisUniqueKey, uniqueKey);
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
header: {
|
|
41
|
+
status: header.status || 'request',
|
|
42
|
+
type: 'main',
|
|
43
|
+
_originData: arg,
|
|
44
|
+
event: e || undefined
|
|
45
|
+
},
|
|
46
|
+
sync,
|
|
47
|
+
code,
|
|
48
|
+
data,
|
|
49
|
+
plugin,
|
|
50
|
+
name
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
console.error(e, arg);
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
__handle_main(e, arg) {
|
|
59
|
+
const rawData = this.__parse_raw_data(e, arg);
|
|
60
|
+
if (!rawData?.header) return;
|
|
61
|
+
if (rawData.header.status === 'reply' && rawData.sync) {
|
|
62
|
+
const { id } = rawData.sync;
|
|
63
|
+
return this.pendingMap.get(id)?.(rawData);
|
|
64
|
+
}
|
|
65
|
+
const listeners = this.channelMap.get(rawData.name);
|
|
66
|
+
if (listeners && listeners.length > 0) {
|
|
67
|
+
this.__dispatch(e, rawData, listeners);
|
|
68
|
+
} else {
|
|
69
|
+
const queue = this.earlyMessageQueue.get(rawData.name) || [];
|
|
70
|
+
queue.push({ e, rawData });
|
|
71
|
+
this.earlyMessageQueue.set(rawData.name, queue);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
__dispatch(e, rawData, listeners) {
|
|
76
|
+
listeners.forEach((func) => {
|
|
77
|
+
const handInData = {
|
|
78
|
+
reply: (code, data) => {
|
|
79
|
+
e.sender.send(
|
|
80
|
+
'@plugin-process-message',
|
|
81
|
+
this.__parse_sender(code, rawData, data, rawData.sync)
|
|
82
|
+
);
|
|
83
|
+
},
|
|
84
|
+
...rawData
|
|
85
|
+
};
|
|
86
|
+
func(handInData);
|
|
87
|
+
handInData.reply(DataCode.SUCCESS, undefined);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
__parse_sender(code, rawData, data, sync) {
|
|
92
|
+
return {
|
|
93
|
+
code,
|
|
94
|
+
data,
|
|
95
|
+
sync: !sync ? undefined : {
|
|
96
|
+
timeStamp: new Date().getTime(),
|
|
97
|
+
timeout: sync.timeout,
|
|
98
|
+
id: sync.id
|
|
99
|
+
},
|
|
100
|
+
name: rawData.name,
|
|
101
|
+
header: {
|
|
102
|
+
status: 'reply',
|
|
103
|
+
type: rawData.header.type,
|
|
104
|
+
_originData: rawData.header._originData
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
regChannel(eventName, callback) {
|
|
110
|
+
const listeners = this.channelMap.get(eventName) || [];
|
|
111
|
+
if (!listeners.includes(callback)) {
|
|
112
|
+
listeners.push(callback);
|
|
113
|
+
} else {
|
|
114
|
+
return () => {};
|
|
115
|
+
}
|
|
116
|
+
this.channelMap.set(eventName, listeners);
|
|
117
|
+
|
|
118
|
+
const earlyMessages = this.earlyMessageQueue.get(eventName);
|
|
119
|
+
if (earlyMessages && earlyMessages.length > 0) {
|
|
120
|
+
this.earlyMessageQueue.delete(eventName);
|
|
121
|
+
earlyMessages.forEach(({ e, rawData }) => {
|
|
122
|
+
this.__dispatch(e, rawData, [callback]);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return () => {
|
|
127
|
+
const index = listeners.indexOf(callback);
|
|
128
|
+
if (index !== -1) {
|
|
129
|
+
listeners.splice(index, 1);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
send(eventName, arg) {
|
|
135
|
+
const uniqueId = Date.now() + '#' + eventName + '@' + Math.random().toString(12);
|
|
136
|
+
const data = {
|
|
137
|
+
code: DataCode.SUCCESS,
|
|
138
|
+
data: arg,
|
|
139
|
+
sync: {
|
|
140
|
+
timeStamp: new Date().getTime(),
|
|
141
|
+
timeout: CHANNEL_DEFAULT_TIMEOUT,
|
|
142
|
+
id: uniqueId
|
|
143
|
+
},
|
|
144
|
+
name: eventName,
|
|
145
|
+
header: {
|
|
146
|
+
uniqueKey,
|
|
147
|
+
status: 'request',
|
|
148
|
+
type: 'plugin'
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
const instance = this;
|
|
152
|
+
return new Promise((resolve, reject) => {
|
|
153
|
+
try {
|
|
154
|
+
ipcRenderer.send('@plugin-process-message', data);
|
|
155
|
+
} catch (error) {
|
|
156
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
157
|
+
console.error('[Plugin] Failed to send channel message', eventName, errorMessage);
|
|
158
|
+
const sendError = new Error('Failed to send plugin channel message "' + eventName + '": ' + errorMessage);
|
|
159
|
+
sendError.code = 'plugin_channel_send_failed';
|
|
160
|
+
reject(sendError);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const timeoutMs = data.sync?.timeout ?? CHANNEL_DEFAULT_TIMEOUT;
|
|
165
|
+
const timeoutHandle = setTimeout(() => {
|
|
166
|
+
if (!instance.pendingMap.has(uniqueId)) return;
|
|
167
|
+
instance.pendingMap.delete(uniqueId);
|
|
168
|
+
const timeoutError = new Error('Plugin channel request "' + eventName + '" timed out after ' + timeoutMs + 'ms');
|
|
169
|
+
timeoutError.code = 'plugin_channel_timeout';
|
|
170
|
+
console.warn(timeoutError.message);
|
|
171
|
+
reject(timeoutError);
|
|
172
|
+
}, timeoutMs);
|
|
173
|
+
|
|
174
|
+
instance.pendingMap.set(uniqueId, (res) => {
|
|
175
|
+
clearTimeout(timeoutHandle);
|
|
176
|
+
instance.pendingMap.delete(uniqueId);
|
|
177
|
+
resolve(res.data);
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
sendSync(eventName, arg) {
|
|
183
|
+
const data = {
|
|
184
|
+
code: DataCode.SUCCESS,
|
|
185
|
+
data: arg,
|
|
186
|
+
name: eventName,
|
|
187
|
+
header: {
|
|
188
|
+
uniqueKey,
|
|
189
|
+
status: 'request',
|
|
190
|
+
type: 'plugin'
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
try {
|
|
194
|
+
const res = this.__parse_raw_data(null, ipcRenderer.sendSync('@plugin-process-message', data));
|
|
195
|
+
if (res?.header?.status === 'reply') return res.data;
|
|
196
|
+
return res;
|
|
197
|
+
} catch (error) {
|
|
198
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
199
|
+
console.error('[Plugin] Failed to sendSync channel message', eventName, errorMessage);
|
|
200
|
+
throw new Error('Failed to sendSync plugin channel message "' + eventName + '": ' + errorMessage);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
window['$channel'] = new TouchChannel();
|
|
206
|
+
})();
|
|
207
|
+
`
|
|
208
|
+
}
|
|
@@ -8,10 +8,16 @@ import type {
|
|
|
8
8
|
AnalyticsSnapshot,
|
|
9
9
|
AnalyticsWindowType,
|
|
10
10
|
} from '../../../analytics'
|
|
11
|
-
import type {
|
|
11
|
+
import type {
|
|
12
|
+
AppIndexAddPathRequest,
|
|
13
|
+
AppIndexAddPathResult,
|
|
14
|
+
AppIndexSettings,
|
|
15
|
+
} from '../../events/types/app-index'
|
|
12
16
|
import type { AnalyticsToggleRequest, CurrentMetrics, PerformanceHistoryEntry, PerformanceSummary } from '../../events/types/app'
|
|
13
17
|
import type { DeviceIdleSettings } from '../../events/types/device-idle'
|
|
14
18
|
import type {
|
|
19
|
+
FileIndexAddPathRequest,
|
|
20
|
+
FileIndexAddPathResult,
|
|
15
21
|
FileIndexBatteryStatus,
|
|
16
22
|
FileIndexFailedFile,
|
|
17
23
|
FileIndexProgress,
|
|
@@ -33,6 +39,7 @@ export interface SettingsSdk {
|
|
|
33
39
|
options: StreamOptions<FileIndexProgress>,
|
|
34
40
|
) => Promise<StreamController>
|
|
35
41
|
getFailedFiles: () => Promise<FileIndexFailedFile[]>
|
|
42
|
+
addPath: (payload: FileIndexAddPathRequest) => Promise<FileIndexAddPathResult>
|
|
36
43
|
}
|
|
37
44
|
deviceIdle: {
|
|
38
45
|
getSettings: () => Promise<DeviceIdleSettings>
|
|
@@ -41,6 +48,7 @@ export interface SettingsSdk {
|
|
|
41
48
|
appIndex: {
|
|
42
49
|
getSettings: () => Promise<AppIndexSettings>
|
|
43
50
|
updateSettings: (settings: Partial<AppIndexSettings>) => Promise<AppIndexSettings>
|
|
51
|
+
addPath: (payload: AppIndexAddPathRequest) => Promise<AppIndexAddPathResult>
|
|
44
52
|
}
|
|
45
53
|
analytics: {
|
|
46
54
|
getSnapshot: (windowType: AnalyticsWindowType) => Promise<AnalyticsSnapshot>
|
|
@@ -66,6 +74,7 @@ export function createSettingsSdk(transport: ITuffTransport): SettingsSdk {
|
|
|
66
74
|
rebuild: request => transport.send(AppEvents.fileIndex.rebuild, request),
|
|
67
75
|
streamProgress: options => transport.stream(AppEvents.fileIndex.progress, undefined, options),
|
|
68
76
|
getFailedFiles: () => transport.send(AppEvents.fileIndex.failedFiles),
|
|
77
|
+
addPath: payload => transport.send(AppEvents.fileIndex.addPath, payload),
|
|
69
78
|
},
|
|
70
79
|
deviceIdle: {
|
|
71
80
|
getSettings: () => transport.send(AppEvents.deviceIdle.getSettings),
|
|
@@ -74,6 +83,7 @@ export function createSettingsSdk(transport: ITuffTransport): SettingsSdk {
|
|
|
74
83
|
appIndex: {
|
|
75
84
|
getSettings: () => transport.send(AppEvents.appIndex.getSettings),
|
|
76
85
|
updateSettings: settings => transport.send(AppEvents.appIndex.updateSettings, settings),
|
|
86
|
+
addPath: payload => transport.send(AppEvents.appIndex.addPath, payload),
|
|
77
87
|
},
|
|
78
88
|
analytics: {
|
|
79
89
|
getSnapshot: windowType => transport.send(AppEvents.analytics.getSnapshot, { windowType }),
|