@axhub/genie 0.2.9 → 0.2.11
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/api-docs.html +2 -2
- package/dist/assets/App-VH1wNUHs.js +259 -0
- package/dist/assets/{ReviewApp-C9K--AQE.js → ReviewApp-D_9EN4TM.js} +1 -1
- package/dist/assets/{_basePickBy-DR_8uFCo.js → _basePickBy-BDnj7-0Z.js} +1 -1
- package/dist/assets/{_baseUniq-D0njlQ_7.js → _baseUniq-Bl0JKOyl.js} +1 -1
- package/dist/assets/{arc-CKlr_Rec.js → arc-DY-4Kev3.js} +1 -1
- package/dist/assets/{architectureDiagram-2XIMDMQ5-BmO_uLUH.js → architectureDiagram-2XIMDMQ5-qw7crNVd.js} +1 -1
- package/dist/assets/{blockDiagram-WCTKOSBZ-DhAeO-56.js → blockDiagram-WCTKOSBZ-B9xg7ep3.js} +1 -1
- package/dist/assets/{c4Diagram-IC4MRINW-C67kFoXx.js → c4Diagram-IC4MRINW-H9xp3ytb.js} +1 -1
- package/dist/assets/channel-CyNUnRfc.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-mLLagvJi.js → chunk-4BX2VUAB-B3EVDUxI.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-Lx-hOjlM.js → chunk-55IACEB6-CGv945ef.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-Bt-XmVUV.js → chunk-FMBD7UC4-uAT4CKWM.js} +1 -1
- package/dist/assets/{chunk-JSJVCQXG-Cya6gaDV.js → chunk-JSJVCQXG-Cbvlpkf7.js} +1 -1
- package/dist/assets/{chunk-KX2RTZJC-Bd7Ig6tF.js → chunk-KX2RTZJC-CcqIuGat.js} +1 -1
- package/dist/assets/{chunk-NQ4KR5QH-5UAE0Vg-.js → chunk-NQ4KR5QH-CgrcsRuX.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-BAxZ8m7w.js → chunk-QZHKN3VN-Cx0APOoV.js} +1 -1
- package/dist/assets/{chunk-WL4C6EOR-DjDPvUUP.js → chunk-WL4C6EOR-BbZirvBk.js} +1 -1
- package/dist/assets/classDiagram-VBA2DB6C-DxBtyz2A.js +1 -0
- package/dist/assets/classDiagram-v2-RAHNMMFH-DxBtyz2A.js +1 -0
- package/dist/assets/clone-C341l3d0.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-D-60XrkJ.js → cose-bilkent-S5V4N54A-CrvmGFLD.js} +1 -1
- package/dist/assets/{dagre-KLK3FWXG-bqu3ZS4K.js → dagre-KLK3FWXG-C-W6VPjS.js} +1 -1
- package/dist/assets/{diagram-E7M64L7V-BueeqoYm.js → diagram-E7M64L7V-IP2q3bL0.js} +1 -1
- package/dist/assets/{diagram-IFDJBPK2-D4fDv2E7.js → diagram-IFDJBPK2-CQaL-XyV.js} +1 -1
- package/dist/assets/{diagram-P4PSJMXO-WqipY3fN.js → diagram-P4PSJMXO-BxBLThfv.js} +1 -1
- package/dist/assets/{erDiagram-INFDFZHY-D0oVnO-x.js → erDiagram-INFDFZHY-Dyl7bJTt.js} +1 -1
- package/dist/assets/{flowDiagram-PKNHOUZH-DzbGyxrr.js → flowDiagram-PKNHOUZH-B7NFMgFK.js} +1 -1
- package/dist/assets/{ganttDiagram-A5KZAMGK-BwhbbgCP.js → ganttDiagram-A5KZAMGK-hReWSDu2.js} +1 -1
- package/dist/assets/{gitGraphDiagram-K3NZZRJ6-DZgAh_KM.js → gitGraphDiagram-K3NZZRJ6-gVgcr0ST.js} +1 -1
- package/dist/assets/{graph-DzKos-N0.js → graph-DNDiJhTn.js} +1 -1
- package/dist/assets/{highlighted-body-TPN3WLV5-CKDMgz3X.js → highlighted-body-TPN3WLV5-DclLmTou.js} +1 -1
- package/dist/assets/index-DBkz_W_P.css +1 -0
- package/dist/assets/index-DdRyoXKh.js +2 -0
- package/dist/assets/{infoDiagram-LFFYTUFH-BFicZbTf.js → infoDiagram-LFFYTUFH-CqQOOzDA.js} +1 -1
- package/dist/assets/{ishikawaDiagram-PHBUUO56-CtihxDxl.js → ishikawaDiagram-PHBUUO56-CZ0iLiHg.js} +1 -1
- package/dist/assets/{journeyDiagram-4ABVD52K-Du00J8_d.js → journeyDiagram-4ABVD52K-DdfYKfNh.js} +1 -1
- package/dist/assets/{kanban-definition-K7BYSVSG-BJi9S0iQ.js → kanban-definition-K7BYSVSG-C5Vf32u6.js} +1 -1
- package/dist/assets/{layout-B80Sityu.js → layout-rvTEu2KS.js} +1 -1
- package/dist/assets/{linear-sRQLOf5H.js → linear-CD9SiYze.js} +1 -1
- package/dist/assets/{mermaid-O7DHMXV3-CBuVs4eJ.js → mermaid-O7DHMXV3-OZ8qWWwa.js} +167 -157
- package/dist/assets/{mindmap-definition-YRQLILUH-C5IL_xi-.js → mindmap-definition-YRQLILUH-CQxrLNVc.js} +1 -1
- package/dist/assets/{pieDiagram-SKSYHLDU-CeTwlJ8z.js → pieDiagram-SKSYHLDU-XgAUByWg.js} +1 -1
- package/dist/assets/{quadrantDiagram-337W2JSQ-COfUcLWt.js → quadrantDiagram-337W2JSQ-CH16ls7G.js} +1 -1
- package/dist/assets/{requirementDiagram-Z7DCOOCP-DSb-CJ5B.js → requirementDiagram-Z7DCOOCP-B_kQO06L.js} +1 -1
- package/dist/assets/{sankeyDiagram-WA2Y5GQK-8jtuVb45.js → sankeyDiagram-WA2Y5GQK-ofe78CyS.js} +1 -1
- package/dist/assets/{sequenceDiagram-2WXFIKYE-C2VpkMwA.js → sequenceDiagram-2WXFIKYE-Ckbxwny6.js} +1 -1
- package/dist/assets/{stateDiagram-RAJIS63D-fmwMqxxc.js → stateDiagram-RAJIS63D-DNtzCk14.js} +1 -1
- package/dist/assets/stateDiagram-v2-FVOUBMTO-B3VPhiE1.js +1 -0
- package/dist/assets/{timeline-definition-YZTLITO2-Dx1hP5lg.js → timeline-definition-YZTLITO2-zT6CklKt.js} +1 -1
- package/dist/assets/{treemap-KZPCXAKY-CkLOdYCZ.js → treemap-KZPCXAKY-y0U2c3xG.js} +1 -1
- package/dist/assets/vendor-codemirror-CMHSJ_9p.js +9 -0
- package/dist/assets/{vennDiagram-LZ73GAT5-D6KWcnln.js → vennDiagram-LZ73GAT5-xKj3SjYG.js} +1 -1
- package/dist/assets/{xychartDiagram-JWTSCODW-6fh6qmzN.js → xychartDiagram-JWTSCODW-Da_qyEoX.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +6 -5
- package/server/acp-runtime/client.js +120 -14
- package/server/acp-runtime/index.js +54 -0
- package/server/acp-runtime/registry.js +2 -2
- package/server/acp-runtime/session-store.js +75 -1
- package/server/cli.js +32 -8
- package/server/database/db.js +20 -0
- package/server/external-agent/ws.js +477 -24
- package/server/index.js +89 -147
- package/server/lan-access/core.js +79 -0
- package/server/lan-access/state.js +102 -0
- package/server/middleware/auth.js +57 -14
- package/server/projects.js +442 -535
- package/server/routes/auth.js +24 -4
- package/server/routes/cli-auth.js +21 -25
- package/server/routes/codex.js +84 -298
- package/server/routes/commands.js +335 -407
- package/server/routes/lan-access.js +231 -0
- package/server/routes/projects.js +154 -158
- package/server/routes/session-core.js +13 -7
- package/server/routes/settings.js +113 -99
- package/server/session-core/eventStore.js +15 -2
- package/server/session-core/providerAdapters.js +28 -28
- package/server/session-core/sessionListMerge.js +47 -0
- package/shared/conversationEvents.js +96 -1
- package/shared/modelConstants.js +79 -99
- package/dist/assets/App-GBcTeeUS.js +0 -460
- package/dist/assets/channel-V3MBjKys.js +0 -1
- package/dist/assets/classDiagram-VBA2DB6C-C790yYiY.js +0 -1
- package/dist/assets/classDiagram-v2-RAHNMMFH-C790yYiY.js +0 -1
- package/dist/assets/clone-BbMGfZwt.js +0 -1
- package/dist/assets/index-DiQlHzGj.js +0 -2
- package/dist/assets/index-Drat2nB9.css +0 -1
- package/dist/assets/stateDiagram-v2-FVOUBMTO-9GGXVWrR.js +0 -1
- package/dist/assets/vendor-codemirror-BxPY6emf.js +0 -39
- package/server/routes/git.js +0 -1110
- package/server/routes/mcp-utils.js +0 -48
- package/server/routes/mcp.js +0 -536
- package/server/routes/taskmaster.js +0 -1963
- package/server/utils/mcp-detector.js +0 -198
- package/server/utils/taskmaster-websocket.js +0 -129
|
@@ -55,6 +55,55 @@ export function resolveDefaultModel(agentKey, requestedModel) {
|
|
|
55
55
|
return normalizedRequestedModel || null;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
function truncateSessionSummary(text, maxLength = 50) {
|
|
59
|
+
const normalizedText = typeof text === 'string' ? text.trim() : '';
|
|
60
|
+
if (!normalizedText) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return normalizedText.length > maxLength
|
|
65
|
+
? `${normalizedText.slice(0, maxLength)}...`
|
|
66
|
+
: normalizedText;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function extractVisibleUserPrompt(value) {
|
|
70
|
+
const text = String(value || '').trim();
|
|
71
|
+
if (!text) {
|
|
72
|
+
return '';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (
|
|
76
|
+
text.startsWith('# AGENTS.md instructions for ') ||
|
|
77
|
+
text.includes('<environment_context>') ||
|
|
78
|
+
text.startsWith('<subagent_notification>') ||
|
|
79
|
+
text.startsWith('</subagent_notification>')
|
|
80
|
+
) {
|
|
81
|
+
return '';
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (text.startsWith('[DYNAMIC CONTEXT V1]')) {
|
|
85
|
+
const marker = '\n\n[USER MESSAGE]\n';
|
|
86
|
+
const markerIndex = text.indexOf(marker);
|
|
87
|
+
if (markerIndex >= 0) {
|
|
88
|
+
return text.slice(markerIndex + marker.length).trim();
|
|
89
|
+
}
|
|
90
|
+
return '';
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const dynamicContextMatch = text.match(
|
|
94
|
+
/^<dynamic_context(?:\s[^>]*)?>[\s\S]*?<\/dynamic_context>\s*<user_message>\s*([\s\S]*?)\s*<\/user_message>$/i
|
|
95
|
+
);
|
|
96
|
+
if (dynamicContextMatch) {
|
|
97
|
+
return String(dynamicContextMatch[1] || '').trim();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return text;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function deriveSessionSummaryFromPrompt(command) {
|
|
104
|
+
return truncateSessionSummary(extractVisibleUserPrompt(command));
|
|
105
|
+
}
|
|
106
|
+
|
|
58
107
|
function unregisterActiveClient(provider, sessionId, client = null) {
|
|
59
108
|
const key = createActiveSessionKey(provider, sessionId);
|
|
60
109
|
if (!key) {
|
|
@@ -226,6 +275,7 @@ export async function executeAgentPrompt({ agentKey, command, options = {}, writ
|
|
|
226
275
|
});
|
|
227
276
|
const resolvedModel = resolveDefaultModel(normalizedAgent, options.model);
|
|
228
277
|
const agentCommand = options.agentCommand || null;
|
|
278
|
+
const sessionSummary = deriveSessionSummaryFromPrompt(command);
|
|
229
279
|
let sessionRecord = null;
|
|
230
280
|
let client = null;
|
|
231
281
|
|
|
@@ -253,6 +303,8 @@ export async function executeAgentPrompt({ agentKey, command, options = {}, writ
|
|
|
253
303
|
projectPath: effectiveProjectPath,
|
|
254
304
|
agentCommand,
|
|
255
305
|
model: resolvedModel,
|
|
306
|
+
summary: sessionSummary,
|
|
307
|
+
title: sessionSummary,
|
|
256
308
|
lastActivity: new Date().toISOString(),
|
|
257
309
|
lastPromptAt: new Date().toISOString(),
|
|
258
310
|
isClosed: false
|
|
@@ -271,6 +323,8 @@ export async function executeAgentPrompt({ agentKey, command, options = {}, writ
|
|
|
271
323
|
projectPath: effectiveProjectPath,
|
|
272
324
|
agentCommand,
|
|
273
325
|
model: resolvedModel,
|
|
326
|
+
summary: sessionSummary,
|
|
327
|
+
title: sessionSummary,
|
|
274
328
|
lastActivity: new Date().toISOString(),
|
|
275
329
|
lastPromptAt: new Date().toISOString(),
|
|
276
330
|
isClosed: false
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
2
|
import os from 'os';
|
|
3
3
|
import path from 'path';
|
|
4
|
+
import { readMirroredConversationEvents } from '../session-core/eventStore.js';
|
|
4
5
|
|
|
5
6
|
function parsePositiveInteger(value, fallback) {
|
|
6
7
|
const parsed = parseInt(value, 10);
|
|
@@ -92,6 +93,73 @@ function createSessionSummary(record) {
|
|
|
92
93
|
};
|
|
93
94
|
}
|
|
94
95
|
|
|
96
|
+
function extractVisibleUserPrompt(value) {
|
|
97
|
+
const text = String(value || '').trim();
|
|
98
|
+
if (!text) {
|
|
99
|
+
return '';
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (
|
|
103
|
+
text.startsWith('# AGENTS.md instructions for ') ||
|
|
104
|
+
text.includes('<environment_context>') ||
|
|
105
|
+
text.startsWith('<subagent_notification>') ||
|
|
106
|
+
text.startsWith('</subagent_notification>')
|
|
107
|
+
) {
|
|
108
|
+
return '';
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (text.startsWith('[DYNAMIC CONTEXT V1]')) {
|
|
112
|
+
const marker = '\n\n[USER MESSAGE]\n';
|
|
113
|
+
const markerIndex = text.indexOf(marker);
|
|
114
|
+
if (markerIndex >= 0) {
|
|
115
|
+
return text.slice(markerIndex + marker.length).trim();
|
|
116
|
+
}
|
|
117
|
+
return '';
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
const dynamicContextMatch = text.match(
|
|
121
|
+
/^<dynamic_context(?:\s[^>]*)?>[\s\S]*?<\/dynamic_context>\s*<user_message>\s*([\s\S]*?)\s*<\/user_message>$/i
|
|
122
|
+
);
|
|
123
|
+
if (dynamicContextMatch) {
|
|
124
|
+
return String(dynamicContextMatch[1] || '').trim();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return text;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function truncateSessionSummary(text, maxLength = 50) {
|
|
131
|
+
const normalizedText = typeof text === 'string' ? text.trim() : '';
|
|
132
|
+
if (!normalizedText) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return normalizedText.length > maxLength
|
|
137
|
+
? `${normalizedText.slice(0, maxLength)}...`
|
|
138
|
+
: normalizedText;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
async function deriveSummaryFromMirroredEvents(record) {
|
|
142
|
+
if (!record?.provider || !record?.sessionId) {
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const events = await readMirroredConversationEvents(record.provider, record.sessionId);
|
|
147
|
+
for (const event of events) {
|
|
148
|
+
if (event?.kind !== 'user_message') {
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const rawText = event?.payload?.text || event?.payload?.message || '';
|
|
153
|
+
const visiblePrompt = extractVisibleUserPrompt(rawText);
|
|
154
|
+
const summary = truncateSessionSummary(visiblePrompt);
|
|
155
|
+
if (summary) {
|
|
156
|
+
return summary;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
|
|
95
163
|
function getSessionActivityTime(record) {
|
|
96
164
|
return new Date(
|
|
97
165
|
record?.closedAt
|
|
@@ -216,7 +284,13 @@ export async function listAcpSessions({ provider = null, projectPath = null } =
|
|
|
216
284
|
const filePaths = await listProviderSessionFiles(currentProvider);
|
|
217
285
|
for (const filePath of filePaths) {
|
|
218
286
|
const record = await readJsonFile(filePath);
|
|
219
|
-
const
|
|
287
|
+
const hydratedRecord = record && !record.summary
|
|
288
|
+
? {
|
|
289
|
+
...record,
|
|
290
|
+
summary: await deriveSummaryFromMirroredEvents(record)
|
|
291
|
+
}
|
|
292
|
+
: record;
|
|
293
|
+
const summary = createSessionSummary(hydratedRecord);
|
|
220
294
|
if (!summary) {
|
|
221
295
|
continue;
|
|
222
296
|
}
|
package/server/cli.js
CHANGED
|
@@ -169,6 +169,18 @@ async function waitForRuntimeStatus(pid, timeoutMs = 10000) {
|
|
|
169
169
|
return null;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
|
+
function shouldAutoOpenHomepage(options = {}, env = process.env) {
|
|
173
|
+
if (options.noOpen || env.AXHUB_GENIE_NO_OPEN === 'true') {
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
if (options.open || env.AXHUB_GENIE_OPEN === 'true') {
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
|
|
172
184
|
function isProcessAlive(pid) {
|
|
173
185
|
if (!Number.isInteger(pid) || pid <= 0) {
|
|
174
186
|
return false;
|
|
@@ -548,7 +560,9 @@ function buildEditorRequest(positionals, options) {
|
|
|
548
560
|
}
|
|
549
561
|
|
|
550
562
|
const channel = requireOption(options, 'channel', '--channel is required for editor commands');
|
|
551
|
-
const targetClientId =
|
|
563
|
+
const targetClientId = typeof options.targetClientId === 'string' && options.targetClientId.trim()
|
|
564
|
+
? options.targetClientId.trim()
|
|
565
|
+
: null;
|
|
552
566
|
|
|
553
567
|
if (commandPath === 'editor snapshot') {
|
|
554
568
|
return {
|
|
@@ -558,7 +572,10 @@ function buildEditorRequest(positionals, options) {
|
|
|
558
572
|
message: {
|
|
559
573
|
type: 'integration.editor.snapshot.get',
|
|
560
574
|
requestId: scope.requestId,
|
|
561
|
-
payload: {
|
|
575
|
+
payload: {
|
|
576
|
+
channel,
|
|
577
|
+
...(targetClientId ? { targetClientId } : {}),
|
|
578
|
+
},
|
|
562
579
|
},
|
|
563
580
|
};
|
|
564
581
|
}
|
|
@@ -573,7 +590,7 @@ function buildEditorRequest(positionals, options) {
|
|
|
573
590
|
requestId: scope.requestId,
|
|
574
591
|
payload: {
|
|
575
592
|
channel,
|
|
576
|
-
targetClientId,
|
|
593
|
+
...(targetClientId ? { targetClientId } : {}),
|
|
577
594
|
...(options.status ? { status: parseCommaSeparatedList(options.status) } : {}),
|
|
578
595
|
...(options.elementKey ? { elementKey: String(options.elementKey).trim() } : {}),
|
|
579
596
|
...(options.limit ? { limit: parsePositiveInteger(options.limit, '--limit') } : {}),
|
|
@@ -592,7 +609,7 @@ function buildEditorRequest(positionals, options) {
|
|
|
592
609
|
requestId: scope.requestId,
|
|
593
610
|
payload: {
|
|
594
611
|
channel,
|
|
595
|
-
targetClientId,
|
|
612
|
+
...(targetClientId ? { targetClientId } : {}),
|
|
596
613
|
elementKey: requireOption(options, 'elementKey', '--element-key is required'),
|
|
597
614
|
downloadPath: resolveOutputDirPath(options.outputDir),
|
|
598
615
|
},
|
|
@@ -610,7 +627,7 @@ function buildEditorRequest(positionals, options) {
|
|
|
610
627
|
requestId: scope.requestId,
|
|
611
628
|
payload: {
|
|
612
629
|
channel,
|
|
613
|
-
targetClientId,
|
|
630
|
+
...(targetClientId ? { targetClientId } : {}),
|
|
614
631
|
downloadPath: resolveOutputDirPath(options.outputDir),
|
|
615
632
|
},
|
|
616
633
|
},
|
|
@@ -627,7 +644,7 @@ function buildEditorRequest(positionals, options) {
|
|
|
627
644
|
requestId: scope.requestId,
|
|
628
645
|
payload: {
|
|
629
646
|
channel,
|
|
630
|
-
targetClientId,
|
|
647
|
+
...(targetClientId ? { targetClientId } : {}),
|
|
631
648
|
elementKey: requireOption(options, 'elementKey', '--element-key is required'),
|
|
632
649
|
state: requireOption(options, 'state', '--state is required'),
|
|
633
650
|
...(buildTaskRef(options) ? { taskRef: buildTaskRef(options) } : {}),
|
|
@@ -947,7 +964,8 @@ Environment Variables:
|
|
|
947
964
|
CLAUDE_CLI_PATH Set custom Claude CLI path
|
|
948
965
|
CONTEXT_WINDOW Set context window size (default: 160000)
|
|
949
966
|
AXHUB_GENIE_STATUS_PATH Set runtime status file path
|
|
950
|
-
|
|
967
|
+
AXHUB_GENIE_OPEN Set to true to auto-open the homepage after startup
|
|
968
|
+
AXHUB_GENIE_NO_OPEN Set to true to force-disable homepage auto-open
|
|
951
969
|
|
|
952
970
|
Documentation:
|
|
953
971
|
${packageJson.homepage || defaultProjectUrl}
|
|
@@ -1032,7 +1050,7 @@ async function startServer() {
|
|
|
1032
1050
|
// Import and run the server
|
|
1033
1051
|
await import('./index.js');
|
|
1034
1052
|
|
|
1035
|
-
if (
|
|
1053
|
+
if (!shouldAutoOpenHomepage()) {
|
|
1036
1054
|
return;
|
|
1037
1055
|
}
|
|
1038
1056
|
|
|
@@ -1141,6 +1159,8 @@ function parseArgs(args) {
|
|
|
1141
1159
|
parsed.options.taskRequestId = arg.split('=')[1];
|
|
1142
1160
|
} else if (arg === '--json') {
|
|
1143
1161
|
parsed.options.json = true;
|
|
1162
|
+
} else if (arg === '--open') {
|
|
1163
|
+
parsed.options.open = true;
|
|
1144
1164
|
} else if (arg === '--no-open') {
|
|
1145
1165
|
parsed.options.noOpen = true;
|
|
1146
1166
|
} else if (arg === '--help' || arg === '-h') {
|
|
@@ -1184,6 +1204,9 @@ async function main() {
|
|
|
1184
1204
|
await runEditorCommand(positionals, options);
|
|
1185
1205
|
break;
|
|
1186
1206
|
}
|
|
1207
|
+
if (options.open) {
|
|
1208
|
+
process.env.AXHUB_GENIE_OPEN = 'true';
|
|
1209
|
+
}
|
|
1187
1210
|
if (options.noOpen) {
|
|
1188
1211
|
process.env.AXHUB_GENIE_NO_OPEN = 'true';
|
|
1189
1212
|
}
|
|
@@ -1242,4 +1265,5 @@ export {
|
|
|
1242
1265
|
normalizeApiBaseUrl,
|
|
1243
1266
|
parseArgs,
|
|
1244
1267
|
runEditorCommand,
|
|
1268
|
+
shouldAutoOpenHomepage,
|
|
1245
1269
|
};
|
package/server/database/db.js
CHANGED
|
@@ -224,6 +224,26 @@ const userDb = {
|
|
|
224
224
|
return toUserPublic(user);
|
|
225
225
|
},
|
|
226
226
|
|
|
227
|
+
ensureDefaultUser: () => {
|
|
228
|
+
const existingUser = userDb.getFirstUser();
|
|
229
|
+
if (existingUser) {
|
|
230
|
+
return existingUser;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const preferredNames = ['genie', 'axhub-genie', 'local-user'];
|
|
234
|
+
for (const username of preferredNames) {
|
|
235
|
+
try {
|
|
236
|
+
return userDb.createUser(username, '');
|
|
237
|
+
} catch (error) {
|
|
238
|
+
if (error?.code !== 'USERNAME_EXISTS') {
|
|
239
|
+
throw error;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return userDb.createUser(`local-user-${Date.now()}`, '');
|
|
245
|
+
},
|
|
246
|
+
|
|
227
247
|
};
|
|
228
248
|
|
|
229
249
|
const apiKeysDb = {
|