Skip to content

Commit e324141

Browse files
authored
Merge pull request #153 from NPC-Worldwide/caug/v0.1.6
fixing update check
2 parents 723a665 + bc2fb98 commit e324141

36 files changed

+2538
-1036
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "incognide",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"description": "Explore the unknown, build the future, own your data.",
55
"author": "Chris Agostino <info@npcworldwi.de>",
66
"main": "src/main.js",

src/ipc/browser.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,22 @@ function register(ctx) {
350350
wc.setWindowOpenHandler(({ url, disposition }) => {
351351
log('[Browser] window.open intercepted:', url, 'disposition:', disposition);
352352

353-
// Google auth — allow as popup so OAuth tokens stay in the webview's session
354-
// (opening in system browser breaks gcloud login, Google Drive, Colab auth flows)
355-
if (url.includes('accounts.google.com') ||
356-
url.includes('accounts.youtube.com') ||
357-
url.includes('myaccount.google.com')) {
358-
log('[Browser] Allowing Google auth popup in-app for OAuth flow');
353+
// SSO/OAuth auth flows — allow as popup so tokens stay in the webview's session
354+
const AUTH_PATTERNS = [
355+
'accounts.google.com', 'accounts.youtube.com', 'myaccount.google.com',
356+
'login.microsoftonline.com', 'login.live.com', 'login.windows.net',
357+
'github.com/login', 'github.com/sessions',
358+
'auth0.com', 'okta.com', 'onelogin.com',
359+
'sso.', '/oauth', '/auth/', '/login', '/signin', '/saml',
360+
'appleid.apple.com', 'idmsa.apple.com',
361+
'api.twitter.com/oauth', 'x.com/i/oauth',
362+
'facebook.com/v', 'facebook.com/dialog',
363+
'linkedin.com/oauth',
364+
'contacts.google.com/widget', 'apis.google.com',
365+
'plus.google.com', 'drive.google.com',
366+
];
367+
if (AUTH_PATTERNS.some(p => url.includes(p))) {
368+
log('[Browser] Allowing auth/SSO popup in-app:', url);
359369
return { action: 'allow' };
360370
}
361371

@@ -369,14 +379,6 @@ function register(ctx) {
369379
return { action: 'deny' };
370380
}
371381

372-
// Google widgets (contacts hovercard, etc.) - allow as popups
373-
if (url.includes('contacts.google.com/widget') ||
374-
url.includes('apis.google.com') ||
375-
url.includes('plus.google.com') ||
376-
url.includes('drive.google.com')) {
377-
return { action: 'allow' };
378-
}
379-
380382
// about:blank or empty URLs: sites like Google Drive call window.open('')
381383
// then set the popup's location. We can't capture the final URL from here,
382384
// so allow it and intercept navigation on the created window.

src/ipc/chat.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,13 @@ function register(ctx) {
460460
assistantMessageId: data.assistantMessageId,
461461
// For sub-branches: the parent of the user message (points to an assistant message)
462462
userParentMessageId: data.userParentMessageId,
463+
// Generation parameters
464+
temperature: data.temperature,
465+
top_p: data.top_p,
466+
top_k: data.top_k,
467+
max_tokens: data.max_tokens,
468+
// Thinking control
469+
disableThinking: data.disableThinking || false,
463470
};
464471

465472
const response = await fetch(apiUrl, {
@@ -829,6 +836,9 @@ function register(ctx) {
829836
ch.tool_calls,
830837
ch.tool_results,
831838
ch.parent_message_id,
839+
ch.input_tokens,
840+
ch.output_tokens,
841+
ch.cost,
832842
json_group_array(
833843
json_object(
834844
'id', ma.id,
@@ -899,7 +909,10 @@ function register(ctx) {
899909
reasoningContent: row.reasoning_content,
900910
toolCalls,
901911
toolResults,
902-
parentMessageId: row.parent_message_id
912+
parentMessageId: row.parent_message_id,
913+
input_tokens: row.input_tokens || 0,
914+
output_tokens: row.output_tokens || 0,
915+
cost: row.cost ? parseFloat(row.cost) : null,
903916
};
904917
delete newRow.attachments_json;
905918
delete newRow.reasoning_content;

src/ipc/filesystem.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,12 +558,24 @@ function register(ctx) {
558558
const bib = spawnSync('bibtex', [base], { encoding: 'utf8', cwd: workingDir });
559559
console.log('[LATEX] Bibtex stdout:', bib.stdout);
560560
console.log('[LATEX] Bibtex stderr:', bib.stderr);
561+
562+
// biber support (for biblatex with backend=biber)
563+
if (bib.status !== 0) {
564+
console.log('[LATEX] bibtex failed, trying biber...');
565+
const biber = spawnSync('biber', [base], { encoding: 'utf8', cwd: workingDir });
566+
console.log('[LATEX] Biber stdout:', biber.stdout);
567+
console.log('[LATEX] Biber stderr:', biber.stderr);
568+
}
561569
}
562570

563571
console.log('[LATEX] Running second pass:', engine, compileArgs, 'in', workingDir);
572+
spawnSync(engine, compileArgs, { encoding: 'utf8', cwd: workingDir });
573+
574+
// Third pass for cross-references
575+
console.log('[LATEX] Running third pass:', engine, compileArgs, 'in', workingDir);
564576
const result = spawnSync(engine, compileArgs, { encoding: 'utf8', cwd: workingDir });
565-
console.log('[LATEX] Second pass stdout:', result.stdout);
566-
console.log('[LATEX] Second pass stderr:', result.stderr);
577+
console.log('[LATEX] Third pass stdout:', result.stdout);
578+
console.log('[LATEX] Third pass stderr:', result.stderr);
567579

568580
const pdfPath = texPath.replace(/\.tex$/, '.pdf');
569581
const ok = result.status === 0;
@@ -573,7 +585,8 @@ function register(ctx) {
573585
return {
574586
ok,
575587
pdfPath,
576-
error: !ok ? result.stderr : null
588+
log: result.stdout || '',
589+
error: !ok ? (result.stderr || result.stdout) : null
577590
};
578591
});
579592

@@ -978,6 +991,10 @@ function register(ctx) {
978991
return os.homedir();
979992
});
980993

994+
ipcMain.handle('getNpcshHome', async () => {
995+
return ctx.NPCSH_BASE || path.join(os.homedir(), '.npcsh');
996+
});
997+
981998
ipcMain.handle('readDirectory', async (_, dir) => {
982999
try {
9831000
const items = await fsPromises.readdir(dir, { withFileTypes: true });

src/ipc/git.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ function register(ctx) {
252252
return {
253253
success: true,
254254
current: branchSummary.current,
255+
all: branchSummary.all,
255256
branches: branchSummary.all,
256257
local: branchSummary.branches
257258
};

0 commit comments

Comments
 (0)