ai-agentmanager 1.63.0 → 1.65.0
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/CHANGELOG.md +37 -0
- package/README.md +168 -3
- package/package.json +1 -1
- package/public/app.js +48 -4
- package/public/autonomy.js +4 -0
- package/public/groups.js +2 -0
- package/public/index.html +7 -0
- package/public/machine.js +2 -0
- package/public/proof.js +194 -0
- package/public/quality.js +81 -3
- package/public/style.css +54 -1
- package/public/valuelens.js +114 -0
- package/src/autonomy.js +81 -10
- package/src/autopilot.js +3 -1
- package/src/brief.js +73 -6
- package/src/cli.js +101 -5
- package/src/config.js +8 -0
- package/src/engines/claude.js +7 -2
- package/src/inbox.js +60 -6
- package/src/manager.js +44 -4
- package/src/mutate.js +456 -0
- package/src/private.js +52 -0
- package/src/proof.js +255 -0
- package/src/quality.js +16 -2
- package/src/record.js +147 -0
- package/src/scorecard.js +40 -2
- package/src/server.js +53 -2
- package/src/service.js +24 -3
package/src/service.js
CHANGED
|
@@ -43,6 +43,19 @@ export function passEnv(source = process.env) {
|
|
|
43
43
|
return env;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Whether the service file's daemon is the one this process talks to: the same home and port. A
|
|
48
|
+
* second daemon (another home or port, as in a trial or a test) is not the login service's.
|
|
49
|
+
*/
|
|
50
|
+
export function serviceIsOurs(text, source = process.env) {
|
|
51
|
+
const of = (key) => new RegExp(`<key>${key}</key><string>([^<]*)</string>|^Environment=${key}=(.*)$`, 'm').exec(String(text ?? ''));
|
|
52
|
+
const unxml = (v) => v.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');
|
|
53
|
+
return ['AGENTMGR_HOME', 'AGENTMGR_PORT'].every((key) => {
|
|
54
|
+
const m = of(key);
|
|
55
|
+
return (m ? unxml(m[1] ?? m[2]) : '') === (source[key] ?? '');
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
46
59
|
const xml = (s) => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
|
47
60
|
|
|
48
61
|
export function plist() {
|
|
@@ -128,18 +141,26 @@ export async function uninstall() {
|
|
|
128
141
|
throw new Error(`Login service is not supported on ${process.platform}`);
|
|
129
142
|
}
|
|
130
143
|
|
|
144
|
+
const ours = (file) => {
|
|
145
|
+
try {
|
|
146
|
+
return serviceIsOurs(fs.readFileSync(file, 'utf8'));
|
|
147
|
+
} catch {
|
|
148
|
+
return true; // loaded without a file we can read: as before
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
|
|
131
152
|
export async function status() {
|
|
132
153
|
if (process.platform === 'darwin') {
|
|
133
154
|
const installed = fs.existsSync(PLIST);
|
|
134
155
|
const loaded = await run('launchctl', ['print', `gui/${uid()}/${LABEL}`]).then(() => true, () => false);
|
|
135
|
-
return { installed, loaded, file: PLIST };
|
|
156
|
+
return { installed, loaded, ours: ours(PLIST), file: PLIST };
|
|
136
157
|
}
|
|
137
158
|
if (process.platform === 'linux') {
|
|
138
159
|
const installed = fs.existsSync(UNIT);
|
|
139
160
|
const loaded = await run('systemctl', ['--user', 'is-active', UNIT_NAME]).then(() => true, () => false);
|
|
140
|
-
return { installed, loaded, file: UNIT };
|
|
161
|
+
return { installed, loaded, ours: ours(UNIT), file: UNIT };
|
|
141
162
|
}
|
|
142
|
-
return { installed: false, loaded: false, file: null };
|
|
163
|
+
return { installed: false, loaded: false, ours: false, file: null };
|
|
143
164
|
}
|
|
144
165
|
|
|
145
166
|
/** Start the service-managed daemon now (after "agentmgr shutdown", launchd won't on its own). */
|