@cydm/magic-shell-agent-node 0.1.17 → 0.1.19
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/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/local-direct-server.js +2 -21
- package/dist/node.js +32 -1
- package/dist/plugin-loader.js +8 -17
- package/dist/primary-agent-bridge.d.ts +0 -1
- package/dist/primary-agent-bridge.js +35 -5
- package/dist/primary-pie-extension/magic-shell-agent/index.js +1019 -0
- package/dist/primary-pie-extension/magic-shell-agent/package.json +9 -0
- package/dist/runtime-assets.d.ts +4 -0
- package/dist/runtime-assets.js +83 -0
- package/dist/workbench/index.html +30 -0
- package/package.json +1 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
function currentDistDir() {
|
|
5
|
+
return path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
}
|
|
7
|
+
function findExistingDirectory(candidates) {
|
|
8
|
+
for (const candidate of candidates) {
|
|
9
|
+
if (!candidate)
|
|
10
|
+
continue;
|
|
11
|
+
try {
|
|
12
|
+
if (existsSync(candidate)) {
|
|
13
|
+
return candidate;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
// Ignore invalid paths while probing runtime assets.
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
function findExistingFile(candidates) {
|
|
23
|
+
for (const candidate of candidates) {
|
|
24
|
+
if (!candidate)
|
|
25
|
+
continue;
|
|
26
|
+
try {
|
|
27
|
+
if (existsSync(candidate)) {
|
|
28
|
+
return candidate;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// Ignore invalid paths while probing runtime assets.
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
export function getPackagedPluginDir() {
|
|
38
|
+
const currentDir = currentDistDir();
|
|
39
|
+
return findExistingDirectory([
|
|
40
|
+
process.env.MAGIC_SHELL_PLUGINS_DIR ? path.resolve(process.env.MAGIC_SHELL_PLUGINS_DIR) : null,
|
|
41
|
+
path.resolve(currentDir, "./plugins"),
|
|
42
|
+
// Development-only fallback for source checkouts.
|
|
43
|
+
path.resolve(currentDir, "../../../plugins"),
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
export function getWorkbenchRoot() {
|
|
47
|
+
const currentDir = currentDistDir();
|
|
48
|
+
const candidates = [
|
|
49
|
+
process.env.MAGIC_SHELL_WORKBENCH_ROOT ? path.resolve(process.env.MAGIC_SHELL_WORKBENCH_ROOT) : null,
|
|
50
|
+
path.resolve(currentDir, "./workbench"),
|
|
51
|
+
// Development-only fallback for source checkouts.
|
|
52
|
+
path.resolve(currentDir, "../../../apps/web/src"),
|
|
53
|
+
];
|
|
54
|
+
for (const candidate of candidates) {
|
|
55
|
+
if (!candidate)
|
|
56
|
+
continue;
|
|
57
|
+
if (existsSync(path.join(candidate, "index.html"))) {
|
|
58
|
+
return candidate;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
export function getPrimaryPieExtensionDistDir() {
|
|
64
|
+
const currentDir = currentDistDir();
|
|
65
|
+
return findExistingDirectory([
|
|
66
|
+
process.env.MAGIC_SHELL_PRIMARY_EXTENSION_DIR ? path.resolve(process.env.MAGIC_SHELL_PRIMARY_EXTENSION_DIR) : null,
|
|
67
|
+
path.resolve(currentDir, "./primary-pie-extension"),
|
|
68
|
+
// Development-only fallback for source checkouts.
|
|
69
|
+
path.resolve(currentDir, "../../primary-pie-extension/dist"),
|
|
70
|
+
]);
|
|
71
|
+
}
|
|
72
|
+
export function getMagicShellCliPath() {
|
|
73
|
+
const currentDir = currentDistDir();
|
|
74
|
+
return findExistingFile([
|
|
75
|
+
process.env.MAGIC_SHELL_CLI_PATH ? path.resolve(process.env.MAGIC_SHELL_CLI_PATH) : null,
|
|
76
|
+
// Installed alongside @cydm/magic-shell under the same @cydm scope.
|
|
77
|
+
path.resolve(currentDir, "../../magic-shell/dist/cli.js"),
|
|
78
|
+
// Installed under @cydm/magic-shell -> node_modules/@cydm/magic-shell-agent-node/dist
|
|
79
|
+
path.resolve(currentDir, "../../../../dist/cli.js"),
|
|
80
|
+
// Development-only fallback for source checkouts.
|
|
81
|
+
path.resolve(currentDir, "../../cli/dist/cli.js"),
|
|
82
|
+
]);
|
|
83
|
+
}
|
|
@@ -629,9 +629,15 @@
|
|
|
629
629
|
flex-direction: column;
|
|
630
630
|
gap: 8px;
|
|
631
631
|
overflow: auto;
|
|
632
|
+
scrollbar-width: none;
|
|
633
|
+
-ms-overflow-style: none;
|
|
632
634
|
min-height: 0;
|
|
633
635
|
}
|
|
634
636
|
|
|
637
|
+
.worker-list::-webkit-scrollbar {
|
|
638
|
+
display: none;
|
|
639
|
+
}
|
|
640
|
+
|
|
635
641
|
.worker-section {
|
|
636
642
|
display: flex;
|
|
637
643
|
flex-direction: column;
|
|
@@ -927,9 +933,15 @@
|
|
|
927
933
|
box-shadow: 0 18px 48px rgba(0,0,0,0.35);
|
|
928
934
|
color: var(--text-primary);
|
|
929
935
|
overflow: auto;
|
|
936
|
+
scrollbar-width: none;
|
|
937
|
+
-ms-overflow-style: none;
|
|
930
938
|
z-index: 20;
|
|
931
939
|
}
|
|
932
940
|
|
|
941
|
+
.worker-detail-panel::-webkit-scrollbar {
|
|
942
|
+
display: none;
|
|
943
|
+
}
|
|
944
|
+
|
|
933
945
|
.worker-detail-panel.active {
|
|
934
946
|
display: block;
|
|
935
947
|
}
|
|
@@ -987,6 +999,12 @@
|
|
|
987
999
|
gap: 4px;
|
|
988
1000
|
max-height: 140px;
|
|
989
1001
|
overflow: auto;
|
|
1002
|
+
scrollbar-width: none;
|
|
1003
|
+
-ms-overflow-style: none;
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
.worker-detail-events::-webkit-scrollbar {
|
|
1007
|
+
display: none;
|
|
990
1008
|
}
|
|
991
1009
|
|
|
992
1010
|
.worker-detail-event {
|
|
@@ -1008,6 +1026,12 @@
|
|
|
1008
1026
|
white-space: pre-wrap;
|
|
1009
1027
|
max-height: 120px;
|
|
1010
1028
|
overflow: auto;
|
|
1029
|
+
scrollbar-width: none;
|
|
1030
|
+
-ms-overflow-style: none;
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
.worker-detail-output::-webkit-scrollbar {
|
|
1034
|
+
display: none;
|
|
1011
1035
|
}
|
|
1012
1036
|
|
|
1013
1037
|
.worker-detail-snapshots {
|
|
@@ -1017,6 +1041,12 @@
|
|
|
1017
1041
|
gap: 4px;
|
|
1018
1042
|
max-height: 120px;
|
|
1019
1043
|
overflow: auto;
|
|
1044
|
+
scrollbar-width: none;
|
|
1045
|
+
-ms-overflow-style: none;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
.worker-detail-snapshots::-webkit-scrollbar {
|
|
1049
|
+
display: none;
|
|
1020
1050
|
}
|
|
1021
1051
|
|
|
1022
1052
|
.worker-detail-snapshot {
|