@hellolynk-ai/trae-work-mcp 0.0.0-stage → 0.4.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/LICENSE +92 -0
  2. package/README.md +101 -2
  3. package/bin/hellolynk-client-setup.mjs +2748 -0
  4. package/bin/hellolynk-mcp-config-shape.mjs +23 -0
  5. package/hellolynk-client-pack-manifest.json +619 -0
  6. package/hellolynk-client-pack-pin.json +4 -0
  7. package/integrations/trae-work/package.json +11 -0
  8. package/integrations/trae-work/runtime/neutral-host-bootstrap.mjs +38 -0
  9. package/integrations/trae-work/runtime/neutral-host-release-entry.mjs +16 -0
  10. package/integrations/trae-work/runtime/trae-work-bootstrap.mjs +30 -0
  11. package/integrations/trae-work/server/dynamic-ui-contract.mjs +376 -0
  12. package/integrations/trae-work/server/host-lifecycle.mjs +128 -0
  13. package/integrations/trae-work/server/mcp-proxy.mjs +181 -0
  14. package/integrations/trae-work/server/mcp-server.mjs +784 -0
  15. package/integrations/trae-work/server/native-task-cdp.mjs +241 -0
  16. package/integrations/trae-work/server/native-task-worker.mjs +199 -0
  17. package/integrations/trae-work/server/neutral-host-adapter.mjs +725 -0
  18. package/integrations/trae-work/server/trae-neutral-production.mjs +97 -0
  19. package/integrations/trae-work/server/trae-ui-launch.mjs +182 -0
  20. package/integrations/trae-work/server/ui-action-gate.mjs +122 -0
  21. package/integrations/trae-work/skills/hellolynk-inbox/SKILL.md +9 -0
  22. package/package.json +61 -4
  23. package/runtime/bootstrap/core/hellolynk-client-account.mjs +180 -0
  24. package/runtime/bootstrap/core/hellolynk-client-core.mjs +770 -0
  25. package/runtime/bootstrap/core/hellolynk-client-profile.mjs +191 -0
  26. package/runtime/bootstrap/core/hellolynk-host-auth.mjs +347 -0
  27. package/runtime/bootstrap/core/hellolynk-host-protected-store.mjs +2721 -0
  28. package/runtime/bootstrap/core/hellolynk-local-process-lock.mjs +157 -0
  29. package/runtime/bootstrap/core/hellolynk-neutral-host-installation-store.mjs +765 -0
  30. package/runtime/bootstrap/core/hellolynk-platform-credential-store.mjs +773 -0
  31. package/runtime/bootstrap/core/hellolynk-runtime-safety.cjs +471 -0
  32. package/runtime/bootstrap/platform/windows/hellolynk-host-protected-store.ps1 +2866 -0
  33. package/runtime/connect-activate.mjs +837 -0
  34. package/runtime/core/hellolynk-agent-configurator.mjs +701 -0
  35. package/runtime/core/hellolynk-client-account.mjs +180 -0
  36. package/runtime/core/hellolynk-client-core.mjs +770 -0
  37. package/runtime/core/hellolynk-client-profile.mjs +191 -0
  38. package/runtime/core/hellolynk-client-update-entry.mjs +31 -0
  39. package/runtime/core/hellolynk-client-update-runtime.mjs +600 -0
  40. package/runtime/core/hellolynk-client-update.mjs +453 -0
  41. package/runtime/core/hellolynk-contact-request-e2ee.mjs +867 -0
  42. package/runtime/core/hellolynk-device-enrollment.mjs +435 -0
  43. package/runtime/core/hellolynk-direct-text-e2ee-client.mjs +1964 -0
  44. package/runtime/core/hellolynk-direct-text-e2ee.mjs +1207 -0
  45. package/runtime/core/hellolynk-host-auth.mjs +347 -0
  46. package/runtime/core/hellolynk-host-protected-store.mjs +2721 -0
  47. package/runtime/core/hellolynk-host-transport-client.mjs +946 -0
  48. package/runtime/core/hellolynk-host.mjs +2374 -0
  49. package/runtime/core/hellolynk-human-confirmation-ledger.mjs +256 -0
  50. package/runtime/core/hellolynk-human-relationship-controller.mjs +1234 -0
  51. package/runtime/core/hellolynk-inbox-read-state.mjs +11 -0
  52. package/runtime/core/hellolynk-indexed-message-store.mjs +1558 -0
  53. package/runtime/core/hellolynk-instance-conversation.mjs +185 -0
  54. package/runtime/core/hellolynk-local-contact-requests.mjs +1733 -0
  55. package/runtime/core/hellolynk-local-contacts.mjs +1228 -0
  56. package/runtime/core/hellolynk-local-data-migration.mjs +766 -0
  57. package/runtime/core/hellolynk-local-data-protection.mjs +747 -0
  58. package/runtime/core/hellolynk-local-identity-trust.mjs +274 -0
  59. package/runtime/core/hellolynk-local-messaging.mjs +3043 -0
  60. package/runtime/core/hellolynk-local-peer-transport.mjs +103 -0
  61. package/runtime/core/hellolynk-local-process-lock.mjs +157 -0
  62. package/runtime/core/hellolynk-model-inbox.mjs +230 -0
  63. package/runtime/core/hellolynk-model-notices.cjs +60 -0
  64. package/runtime/core/hellolynk-native-addressing-tools.cjs +231 -0
  65. package/runtime/core/hellolynk-native-conversations.mjs +280 -0
  66. package/runtime/core/hellolynk-native-human-confirmation-broker.mjs +1036 -0
  67. package/runtime/core/hellolynk-native-inbox-runtime.mjs +553 -0
  68. package/runtime/core/hellolynk-native-notice.mjs +50 -0
  69. package/runtime/core/hellolynk-native-reply-routes.mjs +96 -0
  70. package/runtime/core/hellolynk-native-worker-lease.mjs +84 -0
  71. package/runtime/core/hellolynk-neutral-host-assembly.mjs +955 -0
  72. package/runtime/core/hellolynk-neutral-host-installation-store.mjs +765 -0
  73. package/runtime/core/hellolynk-neutral-host-launcher.mjs +665 -0
  74. package/runtime/core/hellolynk-neutral-host-process.mjs +4374 -0
  75. package/runtime/core/hellolynk-neutral-host-store-adapters.mjs +548 -0
  76. package/runtime/core/hellolynk-neutral-host-workbench-read-model.mjs +1365 -0
  77. package/runtime/core/hellolynk-platform-credential-store.mjs +773 -0
  78. package/runtime/core/hellolynk-relay-client-cli.mjs +232 -0
  79. package/runtime/core/hellolynk-release-retention.mjs +277 -0
  80. package/runtime/core/hellolynk-runtime-safety.cjs +471 -0
  81. package/runtime/core/hellolynk-workbench-action-grants.mjs +457 -0
  82. package/runtime/core/hellolynk-workbench-connection.mjs +234 -0
  83. package/runtime/neutral-host-bootstrap.mjs +38 -0
  84. package/runtime/neutral-host-release-entry.mjs +16 -0
  85. package/runtime/neutral-host-release-loader.mjs +156 -0
  86. package/runtime/neutral-host-release-manifest.json +394 -0
  87. package/runtime/neutral-host-release-pin.json +4 -0
  88. package/runtime/platform/windows/configure-agent.ps1 +281 -0
  89. package/runtime/platform/windows/credential-store.ps1 +844 -0
  90. package/runtime/platform/windows/hellolynk-host-protected-store.ps1 +2866 -0
  91. package/runtime/platform/windows/hellolynk-human-confirmation-ledger.ps1 +155 -0
  92. package/runtime/platform/windows/hellolynk-local-data-key.ps1 +300 -0
  93. package/runtime/platform/windows/hellolynk-native-human-confirmation-broker.ps1 +216 -0
  94. package/runtime/trae-work-bootstrap.mjs +30 -0
  95. package/runtime/workbench/candidate-bootstrap.mjs +54 -0
  96. package/runtime/workbench/contract.mjs +1314 -0
  97. package/runtime/workbench/hellolynk-workbench-build.json +215 -0
  98. package/runtime/workbench/host-capabilities.mjs +80 -0
  99. package/runtime/workbench/i18n.mjs +1127 -0
  100. package/runtime/workbench/loopback-surface.mjs +740 -0
  101. package/runtime/workbench/mcp-app-bundle.mjs +97 -0
  102. package/runtime/workbench/service.mjs +485 -0
  103. package/runtime/workbench/state.mjs +421 -0
  104. package/runtime/workbench/transports.mjs +171 -0
  105. package/runtime/workbench/ui/app.mjs +6120 -0
  106. package/runtime/workbench/ui/connection-form.mjs +155 -0
  107. package/runtime/workbench/ui/hellolynk-mark.png +0 -0
  108. package/runtime/workbench/ui/http-transport.mjs +247 -0
  109. package/runtime/workbench/ui/icons/arrow-left.svg +3 -0
  110. package/runtime/workbench/ui/icons/close.svg +3 -0
  111. package/runtime/workbench/ui/icons/contacts.svg +3 -0
  112. package/runtime/workbench/ui/icons/inbox.svg +3 -0
  113. package/runtime/workbench/ui/icons/refresh.svg +3 -0
  114. package/runtime/workbench/ui/icons/search.svg +3 -0
  115. package/runtime/workbench/ui/icons/security.svg +3 -0
  116. package/runtime/workbench/ui/icons/settings.svg +3 -0
  117. package/runtime/workbench/ui/index.html +139 -0
  118. package/runtime/workbench/ui/loopback-entry.mjs +26 -0
  119. package/runtime/workbench/ui/mcp-app-client.mjs +151 -0
  120. package/runtime/workbench/ui/mcp-app-entry.mjs +452 -0
  121. package/runtime/workbench/ui/styles.css +686 -0
  122. package/tools/hellolynk-activate-neutral-host-clients.mjs +837 -0
  123. package/tools/hellolynk-install-client-skills.mjs +1211 -0
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ import path from "node:path";
3
+ import { fileURLToPath, pathToFileURL } from "node:url";
4
+ import { isWorkbenchConnectionRequired } from "./core/hellolynk-workbench-connection.mjs";
5
+ import { resolveClientAccountRoot } from "./core/hellolynk-client-account.mjs";
6
+ import { createHostProtectedStore } from "./core/hellolynk-host-protected-store.mjs";
7
+ import { createNeutralHostInstallationStore, defaultNeutralHostStoreRoot } from "./core/hellolynk-neutral-host-installation-store.mjs";
8
+ import { verifyPinnedBootstrap } from "../integrations/trae-work/server/host-lifecycle.mjs";
9
+
10
+ const RELEASE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
11
+ export async function runTraeWorkBootstrap(argv = process.argv.slice(2), options = {}) {
12
+ const expected = parse(argv); const root = resolveClientAccountRoot("trae-work", options.storeRoot || defaultNeutralHostStoreRoot("win32", options.env || process.env));
13
+ const installationStore = createNeutralHostInstallationStore({ root }); const store = createHostProtectedStore({ root, installationStore });
14
+ let binding;
15
+ try { binding = await store.resolveTraeWorkNeutralBinding(); }
16
+ catch (error) { if (!isWorkbenchConnectionRequired(error)) throw error; }
17
+ const verification = binding || {
18
+ adapterId: "trae-work", profileId: "hellolynk-host-trae-work-v2", version: 2, scopes: [],
19
+ region: "intl", principalId: "connection-preflight", delegateId: "connection-preflight", hostInstallationId: "connection-preflight",
20
+ releaseRoot: RELEASE_ROOT, releaseManifestSha256: expected, runnerRelativePath: "runtime/neutral-host-bootstrap.mjs",
21
+ runtimeRoot: path.join(root, "runtime"), profileManifestPath: path.join(root, "profile-manifest-v1.json"),
22
+ };
23
+ if (path.resolve(verification.releaseRoot || "") !== RELEASE_ROOT || verification.releaseManifestSha256 !== expected) throw codeError("neutral_trae_work_runner_integrity_invalid");
24
+ await verifyPinnedBootstrap(verification, { storeRoot: root });
25
+ const proxy = await import(pathToFileURL(path.join(RELEASE_ROOT, "integrations", "trae-work", "server", "mcp-proxy.mjs")).href);
26
+ return proxy.runTraeWorkMcpProxy({ storeRoot: root });
27
+ }
28
+ function parse(argv) { if (argv.length !== 3 || argv[0] !== "run" || argv[1] !== "--expected-manifest-sha256" || !/^[a-f0-9]{64}$/.test(String(argv[2] || ""))) throw codeError("trae_work_bootstrap_arguments_invalid"); return argv[2]; }
29
+ function codeError(code) { const error = new Error(code); error.code = code; return error; }
30
+ if (process.argv[1] && pathToFileURL(process.argv[1]).href === import.meta.url) runTraeWorkBootstrap().catch((error) => { process.stderr.write(`${JSON.stringify({ ok: false, error: error.code || "trae_work_bootstrap_failed" })}\n`); process.exitCode = 1; });
@@ -0,0 +1,54 @@
1
+ import { workbenchLaunchPlan } from "./host-capabilities.mjs";
2
+ import { createWorkbenchLoopbackSurface } from "./loopback-surface.mjs";
3
+ import { composeWorkbenchMcpAppHtml } from "./mcp-app-bundle.mjs";
4
+
5
+ export async function bootstrapWorkbenchCandidate(host, options = {}) {
6
+ const plan = workbenchLaunchPlan(host);
7
+ if (plan.transport === "mcp-app-rpc") {
8
+ const bundle = await composeWorkbenchMcpAppHtml({ withManifest: true });
9
+ const resourceUri = options.resourceUri || "ui://hellolynk/workbench-phase-c-candidate.html";
10
+ if (!/^ui:\/\/hellolynk\/[a-z0-9][a-z0-9._/-]{1,120}\.html$/.test(resourceUri)) {
11
+ throw new Error("workbench_candidate_resource_uri_invalid");
12
+ }
13
+ return Object.freeze({
14
+ host,
15
+ plan,
16
+ kind: "mcp-app-resource",
17
+ resourceUri,
18
+ html: bundle.html,
19
+ manifest: bundle.manifest,
20
+ close: async () => {},
21
+ });
22
+ }
23
+ if (plan.transport !== "loopback-http") throw new Error("workbench_candidate_transport_unsupported");
24
+ if (options.trustedParentOrigin != null && host !== "openclaw") {
25
+ throw new Error("workbench_candidate_parent_origin_host_invalid");
26
+ }
27
+ if (!options.adapter || typeof options.adapter.readSnapshot !== "function") {
28
+ throw new Error("workbench_candidate_read_adapter_required");
29
+ }
30
+ const surface = createWorkbenchLoopbackSurface({
31
+ adapter: options.adapter,
32
+ workbenchRoot: options.workbenchRoot,
33
+ connectAccount: options.connectAccount,
34
+ readAccountState: options.readAccountState || options.connectAccount?.readAccountState,
35
+ disconnectAccount: options.disconnectAccount || options.connectAccount?.disconnectAccount,
36
+ runForAccount: options.runForAccount || options.connectAccount?.runForAccount,
37
+ runSafetyVerificationForAccount: options.runSafetyVerificationForAccount || options.connectAccount?.runSafetyVerificationForAccount,
38
+ openAccount: options.openAccount,
39
+ port: options.port,
40
+ pagePath: options.pagePath || plan.pagePath,
41
+ explicitSyntheticMarker: options.explicitSyntheticMarker === true,
42
+ allowSameSiteTopLevelNavigation: options.allowSameSiteTopLevelNavigation === true,
43
+ trustedParentOrigin: options.trustedParentOrigin,
44
+ });
45
+ const started = await surface.start();
46
+ return Object.freeze({
47
+ host,
48
+ plan,
49
+ kind: "loopback-top-level",
50
+ surface,
51
+ ...started,
52
+ close: () => surface.close(),
53
+ });
54
+ }