symforge 1.2.2 → 1.2.4
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/LICENSE +73 -0
- package/bin/launcher.js +42 -2
- package/package.json +4 -3
- package/scripts/install.js +60 -53
package/LICENSE
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
PolyForm Noncommercial License 1.0.0
|
|
2
|
+
|
|
3
|
+
Required Notice: Copyright (c) 2026 special-place-administrator
|
|
4
|
+
|
|
5
|
+
Acceptance
|
|
6
|
+
|
|
7
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
8
|
+
|
|
9
|
+
Copyright License
|
|
10
|
+
|
|
11
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to Distribution License and make changes or new works based on the software according to Changes and New Works License.
|
|
12
|
+
|
|
13
|
+
Distribution License
|
|
14
|
+
|
|
15
|
+
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by Changes and New Works License.
|
|
16
|
+
|
|
17
|
+
Notices
|
|
18
|
+
|
|
19
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
20
|
+
|
|
21
|
+
Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
22
|
+
|
|
23
|
+
Changes and New Works License
|
|
24
|
+
|
|
25
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
26
|
+
|
|
27
|
+
Patent License
|
|
28
|
+
|
|
29
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
30
|
+
|
|
31
|
+
Noncommercial Purposes
|
|
32
|
+
|
|
33
|
+
Any noncommercial purpose is a permitted purpose.
|
|
34
|
+
|
|
35
|
+
Personal Uses
|
|
36
|
+
|
|
37
|
+
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
|
|
38
|
+
|
|
39
|
+
Noncommercial Organizations
|
|
40
|
+
|
|
41
|
+
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
42
|
+
|
|
43
|
+
Fair Use
|
|
44
|
+
|
|
45
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
46
|
+
|
|
47
|
+
No Other Rights
|
|
48
|
+
|
|
49
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
50
|
+
|
|
51
|
+
Patent Defense
|
|
52
|
+
|
|
53
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
54
|
+
|
|
55
|
+
Violations
|
|
56
|
+
|
|
57
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
58
|
+
|
|
59
|
+
No Liability
|
|
60
|
+
|
|
61
|
+
As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
|
|
62
|
+
|
|
63
|
+
Definitions
|
|
64
|
+
|
|
65
|
+
The licensor is the individual or entity offering these terms, and the software is the software the licensor makes available under these terms.
|
|
66
|
+
|
|
67
|
+
You refers to the individual or entity agreeing to these terms.
|
|
68
|
+
|
|
69
|
+
Your company is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. Control means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
70
|
+
|
|
71
|
+
Your licenses are all the licenses granted to you for the software under these terms.
|
|
72
|
+
|
|
73
|
+
Use means anything you do with the software requiring one of your licenses.
|
package/bin/launcher.js
CHANGED
|
@@ -32,6 +32,8 @@ function createLauncher(overrides = {}) {
|
|
|
32
32
|
const installDir = resolveInstallDir();
|
|
33
33
|
const binPath = pathMod.join(installDir, "symforge" + ext);
|
|
34
34
|
const pendingPath = pathMod.join(installDir, "symforge.pending" + ext);
|
|
35
|
+
const versionPath = pathMod.join(installDir, "symforge.version");
|
|
36
|
+
const pendingVersionPath = pathMod.join(installDir, "symforge.pending.version");
|
|
35
37
|
|
|
36
38
|
function relayInstallerOutput(output) {
|
|
37
39
|
if (!output) {
|
|
@@ -45,15 +47,48 @@ function createLauncher(overrides = {}) {
|
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
|
|
50
|
+
function parseVersion(text) {
|
|
51
|
+
if (!text) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const match = String(text).match(/(\d+\.\d+\.\d+)/);
|
|
55
|
+
return match ? match[1] : null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function readRecordedVersion(targetPath) {
|
|
59
|
+
try {
|
|
60
|
+
return parseVersion(fsMod.readFileSync(targetPath, "utf8").trim());
|
|
61
|
+
} catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function writeRecordedVersion(targetPath, version) {
|
|
67
|
+
if (!version) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
fsMod.writeFileSync(targetPath, `${version}\n`);
|
|
72
|
+
} catch {
|
|
73
|
+
// Best-effort metadata only.
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
48
77
|
function getInstalledVersion() {
|
|
78
|
+
const recordedVersion = readRecordedVersion(versionPath);
|
|
79
|
+
if (recordedVersion) {
|
|
80
|
+
return recordedVersion;
|
|
81
|
+
}
|
|
82
|
+
|
|
49
83
|
try {
|
|
50
84
|
const output = execFileSyncFn(binPath, ["--version"], {
|
|
51
85
|
encoding: "utf8",
|
|
52
86
|
timeout: 5000,
|
|
53
87
|
env: processMod.env,
|
|
54
88
|
}).trim();
|
|
55
|
-
const
|
|
56
|
-
|
|
89
|
+
const parsedVersion = parseVersion(output);
|
|
90
|
+
writeRecordedVersion(versionPath, parsedVersion);
|
|
91
|
+
return parsedVersion;
|
|
57
92
|
} catch {
|
|
58
93
|
return null;
|
|
59
94
|
}
|
|
@@ -66,6 +101,11 @@ function createLauncher(overrides = {}) {
|
|
|
66
101
|
|
|
67
102
|
try {
|
|
68
103
|
fsMod.renameSync(pendingPath, binPath);
|
|
104
|
+
if (fsMod.existsSync(pendingVersionPath)) {
|
|
105
|
+
fsMod.renameSync(pendingVersionPath, versionPath);
|
|
106
|
+
} else {
|
|
107
|
+
writeRecordedVersion(versionPath, packageJson.version);
|
|
108
|
+
}
|
|
69
109
|
consoleMod.error("symforge: applied pending update.");
|
|
70
110
|
return true;
|
|
71
111
|
} catch {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "symforge",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "SymForge — in-memory code intelligence for Claude Code, Codex, and Gemini CLI",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/special-place-administrator/symforge"
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"bin/",
|
|
19
|
-
"scripts/"
|
|
19
|
+
"scripts/",
|
|
20
|
+
"LICENSE"
|
|
20
21
|
],
|
|
21
22
|
"keywords": [
|
|
22
23
|
"mcp",
|
package/scripts/install.js
CHANGED
|
@@ -8,7 +8,7 @@ const os = require("os");
|
|
|
8
8
|
const https = require("https");
|
|
9
9
|
const http = require("http");
|
|
10
10
|
|
|
11
|
-
const REPO = "special-place-administrator/
|
|
11
|
+
const REPO = "special-place-administrator/symforge";
|
|
12
12
|
|
|
13
13
|
function createInstaller(overrides = {}) {
|
|
14
14
|
const fsMod = overrides.fs || fs;
|
|
@@ -34,6 +34,8 @@ function createInstaller(overrides = {}) {
|
|
|
34
34
|
// Binary lives outside node_modules so npm can update the JS wrapper
|
|
35
35
|
// even while the MCP server holds a lock on the running .exe (Windows).
|
|
36
36
|
const installDir = resolveInstallDir();
|
|
37
|
+
const versionPath = pathMod.join(installDir, "symforge.version");
|
|
38
|
+
const pendingVersionPath = pathMod.join(installDir, "symforge.pending.version");
|
|
37
39
|
|
|
38
40
|
function getPlatformArtifact() {
|
|
39
41
|
const platform = processMod.platform;
|
|
@@ -63,6 +65,33 @@ function createInstaller(overrides = {}) {
|
|
|
63
65
|
return pathMod.join(installDir, "symforge.pending" + ext);
|
|
64
66
|
}
|
|
65
67
|
|
|
68
|
+
function parseVersion(text) {
|
|
69
|
+
if (!text) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
const match = String(text).match(/(\d+\.\d+\.\d+)/);
|
|
73
|
+
return match ? match[1] : null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function readRecordedVersion(targetPath) {
|
|
77
|
+
try {
|
|
78
|
+
return parseVersion(fsMod.readFileSync(targetPath, "utf8").trim());
|
|
79
|
+
} catch {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function writeRecordedVersion(targetPath, version) {
|
|
85
|
+
if (!version) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
fsMod.writeFileSync(targetPath, `${version}\n`);
|
|
90
|
+
} catch {
|
|
91
|
+
// Best-effort metadata only.
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
66
95
|
function download(url) {
|
|
67
96
|
if (overrides.download) {
|
|
68
97
|
return overrides.download(url);
|
|
@@ -85,13 +114,19 @@ function createInstaller(overrides = {}) {
|
|
|
85
114
|
}
|
|
86
115
|
|
|
87
116
|
function getInstalledVersion(binPath) {
|
|
117
|
+
const recordedVersion = readRecordedVersion(versionPath);
|
|
118
|
+
if (recordedVersion) {
|
|
119
|
+
return recordedVersion;
|
|
120
|
+
}
|
|
121
|
+
|
|
88
122
|
try {
|
|
89
123
|
const output = execFileSyncFn(binPath, ["--version"], {
|
|
90
124
|
encoding: "utf8",
|
|
91
125
|
timeout: 5000,
|
|
92
126
|
}).trim();
|
|
93
|
-
const
|
|
94
|
-
|
|
127
|
+
const parsedVersion = parseVersion(output);
|
|
128
|
+
writeRecordedVersion(versionPath, parsedVersion);
|
|
129
|
+
return parsedVersion;
|
|
95
130
|
} catch {
|
|
96
131
|
return null;
|
|
97
132
|
}
|
|
@@ -101,16 +136,19 @@ function createInstaller(overrides = {}) {
|
|
|
101
136
|
return error && (error.code === "EPERM" || error.code === "EBUSY");
|
|
102
137
|
}
|
|
103
138
|
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
139
|
+
function removePendingArtifacts(pendingPath) {
|
|
140
|
+
for (const target of [pendingPath, pendingVersionPath]) {
|
|
141
|
+
try {
|
|
142
|
+
fsMod.unlinkSync(target);
|
|
143
|
+
} catch {}
|
|
144
|
+
}
|
|
108
145
|
}
|
|
109
146
|
|
|
110
147
|
function writeInstalledBinary(binPath, pendingPath, data) {
|
|
111
148
|
fsMod.writeFileSync(binPath, data);
|
|
112
149
|
fsMod.chmodSync(binPath, 0o755);
|
|
113
|
-
|
|
150
|
+
writeRecordedVersion(versionPath, getVersion());
|
|
151
|
+
removePendingArtifacts(pendingPath);
|
|
114
152
|
consoleMod.log(`Installed: ${binPath}`);
|
|
115
153
|
}
|
|
116
154
|
|
|
@@ -153,48 +191,19 @@ function createInstaller(overrides = {}) {
|
|
|
153
191
|
}
|
|
154
192
|
|
|
155
193
|
/**
|
|
156
|
-
* Stop symforge
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* Daemons are identifiable because they were launched with the `daemon` arg,
|
|
160
|
-
* visible in the process command line. On Windows we filter via WMI
|
|
161
|
-
* CommandLine; on Unix we use `pkill -f`.
|
|
194
|
+
* Stop all running symforge processes before an update. This includes
|
|
195
|
+
* active stdio MCP sessions; callers are expected to run updates only when
|
|
196
|
+
* interrupting those sessions is acceptable.
|
|
162
197
|
*
|
|
163
198
|
* Returns an array of killed PIDs (Windows) or [] (Unix, best-effort).
|
|
164
199
|
*/
|
|
165
|
-
function
|
|
200
|
+
function stopAllRunningProcesses(binPath) {
|
|
166
201
|
if (processMod.platform === "win32") {
|
|
167
|
-
|
|
168
|
-
// This avoids killing the MCP stdio process that Claude Code is using.
|
|
169
|
-
// NOTE: PowerShell -and operators must stay on the same line as their
|
|
170
|
-
// operands — semicolons are statement terminators, not line joiners.
|
|
171
|
-
const script = [
|
|
172
|
-
"$procs = Get-CimInstance Win32_Process | Where-Object { $_.Name -eq 'symforge.exe' -and $_.CommandLine -and $_.CommandLine -match '\\bdaemon\\b' }",
|
|
173
|
-
"$ids = @($procs | ForEach-Object { [int]$_.ProcessId })",
|
|
174
|
-
"if ($ids.Count -gt 0) { Stop-Process -Id $ids -Force -ErrorAction SilentlyContinue; $ids | ConvertTo-Json -Compress }",
|
|
175
|
-
].join("; ");
|
|
176
|
-
|
|
177
|
-
try {
|
|
178
|
-
const output = execFileSyncFn(
|
|
179
|
-
"powershell.exe",
|
|
180
|
-
["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", script],
|
|
181
|
-
{ encoding: "utf8", env: processMod.env }
|
|
182
|
-
).trim();
|
|
183
|
-
|
|
184
|
-
if (!output) return [];
|
|
185
|
-
const parsed = JSON.parse(output);
|
|
186
|
-
return Array.isArray(parsed) ? parsed : [parsed];
|
|
187
|
-
} catch (error) {
|
|
188
|
-
consoleMod.log(
|
|
189
|
-
`Note: could not stop daemon processes: ${error.message}`
|
|
190
|
-
);
|
|
191
|
-
return [];
|
|
192
|
-
}
|
|
202
|
+
return stopRunningWindowsProcesses(binPath);
|
|
193
203
|
}
|
|
194
204
|
|
|
195
|
-
// Unix: kill only daemon processes (best-effort)
|
|
196
205
|
try {
|
|
197
|
-
execSyncFn("pkill -
|
|
206
|
+
execSyncFn("pkill -x symforge 2>/dev/null || true", {
|
|
198
207
|
encoding: "utf8",
|
|
199
208
|
});
|
|
200
209
|
} catch {
|
|
@@ -242,6 +251,7 @@ function createInstaller(overrides = {}) {
|
|
|
242
251
|
|
|
243
252
|
fsMod.writeFileSync(pendingPath, data);
|
|
244
253
|
fsMod.chmodSync(pendingPath, 0o755);
|
|
254
|
+
writeRecordedVersion(pendingVersionPath, getVersion());
|
|
245
255
|
consoleMod.log(`Binary is locked (MCP server running). Staged update at: ${pendingPath}`);
|
|
246
256
|
consoleMod.log(`Update will apply automatically on next launch.`);
|
|
247
257
|
return { status: "staged", stoppedProcessIds };
|
|
@@ -314,7 +324,7 @@ function createInstaller(overrides = {}) {
|
|
|
314
324
|
if (fsMod.existsSync(binPath)) {
|
|
315
325
|
const installed = getInstalledVersion(binPath);
|
|
316
326
|
if (installed === version) {
|
|
317
|
-
|
|
327
|
+
removePendingArtifacts(pendingPath);
|
|
318
328
|
consoleMod.log(`symforge v${version} already installed at ${binPath}`);
|
|
319
329
|
// Still run init to ensure config is up to date
|
|
320
330
|
runAutoInit(binPath);
|
|
@@ -325,15 +335,12 @@ function createInstaller(overrides = {}) {
|
|
|
325
335
|
);
|
|
326
336
|
}
|
|
327
337
|
|
|
328
|
-
// Stop
|
|
329
|
-
//
|
|
330
|
-
|
|
331
|
-
// the stdio process, the installer will stage to .pending and the
|
|
332
|
-
// launcher will apply it on next start.
|
|
333
|
-
const stoppedPids = stopDaemonProcesses();
|
|
338
|
+
// Stop all running SymForge processes before install so the binary can be
|
|
339
|
+
// replaced in place, even if a live stdio MCP session is currently using it.
|
|
340
|
+
const stoppedPids = stopAllRunningProcesses(binPath);
|
|
334
341
|
if (stoppedPids.length > 0) {
|
|
335
342
|
consoleMod.log(
|
|
336
|
-
`Stopped ${stoppedPids.length}
|
|
343
|
+
`Stopped ${stoppedPids.length} running SymForge process(es) for update`
|
|
337
344
|
);
|
|
338
345
|
// Brief pause to let OS release file handles
|
|
339
346
|
await sleep(500);
|
|
@@ -379,7 +386,7 @@ function createInstaller(overrides = {}) {
|
|
|
379
386
|
consoleMod.error("");
|
|
380
387
|
consoleMod.error("You can build from source instead:");
|
|
381
388
|
consoleMod.error(" git clone https://github.com/" + REPO);
|
|
382
|
-
consoleMod.error(" cd
|
|
389
|
+
consoleMod.error(" cd symforge");
|
|
383
390
|
consoleMod.error(" cargo build --release");
|
|
384
391
|
processMod.exit(1);
|
|
385
392
|
}
|
|
@@ -392,8 +399,8 @@ function createInstaller(overrides = {}) {
|
|
|
392
399
|
installDownloadedBinary,
|
|
393
400
|
isLockedError,
|
|
394
401
|
main,
|
|
402
|
+
stopAllRunningProcesses,
|
|
395
403
|
stopRunningWindowsProcesses,
|
|
396
|
-
stopDaemonProcesses,
|
|
397
404
|
detectClients,
|
|
398
405
|
runAutoInit,
|
|
399
406
|
};
|