shennian 0.2.28 → 0.2.29
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/src/agents/command-spec.js +2 -3
- package/dist/src/agents/model-registry/discovery.js +10 -9
- package/dist/src/agents/openclaw.js +3 -2
- package/dist/src/commands/daemon.d.ts +2 -0
- package/dist/src/commands/daemon.js +3 -0
- package/dist/src/index.js +8 -4
- package/dist/src/session/manager.d.ts +0 -1
- package/dist/src/session/manager.js +2 -1
- package/package.json +1 -1
|
@@ -16,9 +16,8 @@ const BUILTIN_COMMANDS = {
|
|
|
16
16
|
{ command: 'agent', args: [], display: 'agent' },
|
|
17
17
|
{ command: 'cursor', args: ['agent'], display: 'cursor agent' },
|
|
18
18
|
],
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
],
|
|
19
|
+
// OpenClaw support is intentionally disabled.
|
|
20
|
+
openclaw: [],
|
|
22
21
|
opencode: [
|
|
23
22
|
{ command: 'opencode', args: [], display: 'opencode' },
|
|
24
23
|
],
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// @test src/__tests__/model-switching.test.ts
|
|
3
3
|
import { createInterface } from 'node:readline';
|
|
4
4
|
import { resolveBuiltinCommand, spawnResolvedCommand } from '../command-spec.js';
|
|
5
|
-
import { fallbackClaudeAliasModels, fallbackGeminiModels, parseCodexAppServerModels, parseCursorModels, parseOpenCodeModels,
|
|
5
|
+
import { fallbackClaudeAliasModels, fallbackGeminiModels, parseCodexAppServerModels, parseCursorModels, parseOpenCodeModels, } from './parsers.js';
|
|
6
6
|
import { runResolvedCommand } from './runner.js';
|
|
7
7
|
import { DISCOVERY_WORKDIR } from './types.js';
|
|
8
8
|
function sendAppServerRpc(proc, pending, id, method, params, timeoutMs) {
|
|
@@ -90,13 +90,13 @@ async function discoverCursorModels() {
|
|
|
90
90
|
const result = await runResolvedCommand(spec, ['--list-models']);
|
|
91
91
|
return parseCursorModels(result.stdout);
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
93
|
+
// OpenClaw support is intentionally disabled.
|
|
94
|
+
// async function discoverOpenClawModels(): Promise<ModelInfo[]> {
|
|
95
|
+
// const spec = resolveBuiltinCommand('openclaw')
|
|
96
|
+
// if (!spec) return []
|
|
97
|
+
// const result = await runResolvedCommand(spec, ['models', 'list', '--json'])
|
|
98
|
+
// return parseOpenClawModels(result.stdout)
|
|
99
|
+
// }
|
|
100
100
|
async function discoverOpenCodeModels() {
|
|
101
101
|
const spec = resolveBuiltinCommand('opencode');
|
|
102
102
|
if (!spec)
|
|
@@ -160,7 +160,8 @@ async function discoverBuiltinModels(type, context) {
|
|
|
160
160
|
case 'cursor':
|
|
161
161
|
return discoverCursorModels();
|
|
162
162
|
case 'openclaw':
|
|
163
|
-
|
|
163
|
+
// OpenClaw support is intentionally disabled.
|
|
164
|
+
return [];
|
|
164
165
|
case 'opencode':
|
|
165
166
|
return discoverOpenCodeModels();
|
|
166
167
|
case 'pi':
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
|
-
import { AgentAdapter
|
|
2
|
+
import { AgentAdapter } from './adapter.js';
|
|
3
3
|
import { resolveBuiltinCommand, spawnResolvedCommand } from './command-spec.js';
|
|
4
4
|
/** Best-effort parse of `openclaw agent --json` stdout; shape may vary by version. */
|
|
5
5
|
function extractResponseText(parsed) {
|
|
@@ -270,4 +270,5 @@ export class OpenClawAdapter extends AgentAdapter {
|
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
|
|
273
|
+
// OpenClaw support is intentionally disabled.
|
|
274
|
+
// registerAgent('openclaw', () => new OpenClawAdapter())
|
|
@@ -156,6 +156,7 @@ export function getDaemonStatus(opts = {}) {
|
|
|
156
156
|
const pid = readPid();
|
|
157
157
|
const running = pid !== null && isRunning(pid);
|
|
158
158
|
const stale = pid !== null && !running;
|
|
159
|
+
const config = loadConfig();
|
|
159
160
|
if (stale && opts.cleanupStale) {
|
|
160
161
|
try {
|
|
161
162
|
fs.unlinkSync(PID_FILE);
|
|
@@ -174,6 +175,8 @@ export function getDaemonStatus(opts = {}) {
|
|
|
174
175
|
shennianDir: SHENNIAN_DIR,
|
|
175
176
|
pidFile: PID_FILE,
|
|
176
177
|
logFile: LOG_FILE,
|
|
178
|
+
...(config.machineId ? { machineId: config.machineId } : {}),
|
|
179
|
+
...(config.serverUrl ? { serverUrl: config.serverUrl } : {}),
|
|
177
180
|
};
|
|
178
181
|
}
|
|
179
182
|
function printJson(value) {
|
package/dist/src/index.js
CHANGED
|
@@ -89,16 +89,20 @@ program
|
|
|
89
89
|
catch {
|
|
90
90
|
// env.json may not exist yet
|
|
91
91
|
}
|
|
92
|
-
// Single-instance guard.
|
|
93
|
-
// need to take over from an older detached
|
|
92
|
+
// Single-instance guard. Service-manager starts are authoritative and may
|
|
93
|
+
// need to take over from an older detached process after app/daemon upgrades.
|
|
94
94
|
const pidFile = resolveShennianPath('daemon.pid');
|
|
95
95
|
try {
|
|
96
96
|
const oldPid = parseInt(fs.readFileSync(pidFile, 'utf-8').trim(), 10);
|
|
97
97
|
if (oldPid && oldPid !== process.pid) {
|
|
98
98
|
try {
|
|
99
99
|
process.kill(oldPid, 0);
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
const serviceManagedStart = Boolean(process.env.INVOCATION_ID ||
|
|
101
|
+
process.env.JOURNAL_STREAM ||
|
|
102
|
+
process.env.SHENNIAN_DESKTOP_CLI_SCRIPT ||
|
|
103
|
+
process.env.SHENNIAN_DESKTOP_CLI_BRIDGE);
|
|
104
|
+
if (serviceManagedStart) {
|
|
105
|
+
console.log(`[${new Date().toISOString()}] managed start taking over from existing daemon (PID ${oldPid})`);
|
|
102
106
|
process.kill(oldPid, 'SIGTERM');
|
|
103
107
|
const stopped = await waitForPidExit(oldPid);
|
|
104
108
|
if (!stopped) {
|
|
@@ -5,7 +5,6 @@ import '../agents/claude.js';
|
|
|
5
5
|
import '../agents/codex.js';
|
|
6
6
|
import '../agents/gemini.js';
|
|
7
7
|
import '../agents/cursor.js';
|
|
8
|
-
import '../agents/openclaw.js';
|
|
9
8
|
import '../agents/opencode.js';
|
|
10
9
|
import '../agents/pi.js';
|
|
11
10
|
export declare function resolveSessionWorkDir(input: string): string;
|
|
@@ -15,7 +15,8 @@ import '../agents/claude.js';
|
|
|
15
15
|
import '../agents/codex.js';
|
|
16
16
|
import '../agents/gemini.js';
|
|
17
17
|
import '../agents/cursor.js';
|
|
18
|
-
|
|
18
|
+
// OpenClaw support is intentionally disabled.
|
|
19
|
+
// import '../agents/openclaw.js'
|
|
19
20
|
import '../agents/opencode.js';
|
|
20
21
|
import '../agents/pi.js';
|
|
21
22
|
import { registerCustomAgent } from '../agents/custom.js';
|