instar 0.23.6 → 0.23.7
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/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +31 -6
- package/dist/commands/server.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +113 -10
- package/dist/commands/setup.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +1 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +8 -1
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/lifeline/MessageQueue.d.ts +2 -0
- package/dist/lifeline/MessageQueue.d.ts.map +1 -1
- package/dist/lifeline/MessageQueue.js.map +1 -1
- package/dist/lifeline/TelegramLifeline.d.ts +9 -0
- package/dist/lifeline/TelegramLifeline.d.ts.map +1 -1
- package/dist/lifeline/TelegramLifeline.js +100 -5
- package/dist/lifeline/TelegramLifeline.js.map +1 -1
- package/dist/messaging/TelegramAdapter.d.ts +10 -0
- package/dist/messaging/TelegramAdapter.d.ts.map +1 -1
- package/dist/messaging/TelegramAdapter.js +86 -0
- package/dist/messaging/TelegramAdapter.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +1 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/types/pipeline.d.ts +3 -3
- package/dist/types/pipeline.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwPH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwPH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA8gCD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA80EtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
|
package/dist/commands/server.js
CHANGED
|
@@ -718,7 +718,8 @@ function messageToPipeline(msg, topicName) {
|
|
|
718
718
|
content: msg.content,
|
|
719
719
|
type: msg.content.startsWith('[voice]') ? 'voice'
|
|
720
720
|
: msg.content.startsWith('[image:') ? 'photo'
|
|
721
|
-
: '
|
|
721
|
+
: msg.content.startsWith('[document:') ? 'document'
|
|
722
|
+
: 'text',
|
|
722
723
|
timestamp: msg.receivedAt,
|
|
723
724
|
};
|
|
724
725
|
}
|
|
@@ -3203,18 +3204,42 @@ export async function startServer(options) {
|
|
|
3203
3204
|
console.warn(`[server] Dashboard topic setup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
3204
3205
|
}
|
|
3205
3206
|
}
|
|
3206
|
-
// Self-healing: ensure autostart is installed
|
|
3207
|
+
// Self-healing: ensure autostart is installed AND uses the correct format.
|
|
3207
3208
|
// This is a non-negotiable requirement — the user must always be able to reach their agent remotely.
|
|
3208
|
-
// If autostart isn't installed, install it silently.
|
|
3209
|
-
// to
|
|
3209
|
+
// If autostart isn't installed, install it silently. If it uses the old /bin/bash entry point
|
|
3210
|
+
// (vulnerable to macOS TCC/FDA restrictions), regenerate it with the node + JS wrapper.
|
|
3210
3211
|
try {
|
|
3211
3212
|
const hasTelegram = !!telegram;
|
|
3212
3213
|
const autostartInstalled = isAutostartInstalled(config.projectName);
|
|
3213
|
-
|
|
3214
|
+
let needsReinstall = !autostartInstalled;
|
|
3215
|
+
// On macOS, check if plist uses the modern JS boot wrapper
|
|
3216
|
+
if (!needsReinstall && process.platform === 'darwin') {
|
|
3217
|
+
const label = `ai.instar.${config.projectName}`;
|
|
3218
|
+
const plistPath = path.join(os.homedir(), 'Library', 'LaunchAgents', `${label}.plist`);
|
|
3219
|
+
try {
|
|
3220
|
+
const plistContent = fs.readFileSync(plistPath, 'utf-8');
|
|
3221
|
+
if (!plistContent.includes('instar-boot.js')) {
|
|
3222
|
+
needsReinstall = true;
|
|
3223
|
+
console.log(pc.yellow(` Auto-start uses legacy format — upgrading to TCC-safe node entry point`));
|
|
3224
|
+
}
|
|
3225
|
+
else {
|
|
3226
|
+
// Verify node path in plist still exists
|
|
3227
|
+
const nodeMatch = plistContent.match(/<string>(\/[^<]+node[^<]*)<\/string>/);
|
|
3228
|
+
if (nodeMatch && !fs.existsSync(nodeMatch[1])) {
|
|
3229
|
+
needsReinstall = true;
|
|
3230
|
+
console.log(pc.yellow(` Auto-start node path stale (${nodeMatch[1]}) — regenerating`));
|
|
3231
|
+
}
|
|
3232
|
+
}
|
|
3233
|
+
}
|
|
3234
|
+
catch { /* plist read failed — will reinstall */
|
|
3235
|
+
needsReinstall = true;
|
|
3236
|
+
}
|
|
3237
|
+
}
|
|
3238
|
+
if (needsReinstall) {
|
|
3214
3239
|
const { installAutoStart } = await import('./setup.js');
|
|
3215
3240
|
const installed = installAutoStart(config.projectName, config.projectDir, hasTelegram);
|
|
3216
3241
|
if (installed) {
|
|
3217
|
-
console.log(pc.green(` Auto-start self-healed: installed ${process.platform === 'darwin' ? 'LaunchAgent' : 'systemd service'}`));
|
|
3242
|
+
console.log(pc.green(` Auto-start self-healed: installed ${process.platform === 'darwin' ? 'LaunchAgent (node + JS wrapper)' : 'systemd service'}`));
|
|
3218
3243
|
}
|
|
3219
3244
|
else {
|
|
3220
3245
|
console.log(pc.yellow(` Auto-start not available on ${process.platform}`));
|