nightcode 1.0.2 → 1.0.4
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/index.js +20 -17
- package/package.json +3 -13
package/dist/index.js
CHANGED
|
@@ -909,7 +909,7 @@ import { createContext as createContext5, useContext as useContext5, useState as
|
|
|
909
909
|
import {
|
|
910
910
|
DEFAULT_CHAT_MODEL_ID,
|
|
911
911
|
Mode
|
|
912
|
-
} from "@
|
|
912
|
+
} from "@nightcodehq/shared";
|
|
913
913
|
import { jsxDEV as jsxDEV6 } from "@opentui/react/jsx-dev-runtime";
|
|
914
914
|
var PromptConfigContext = createContext5(null);
|
|
915
915
|
function usePromptConfig() {
|
|
@@ -995,7 +995,7 @@ import { useNavigate as useNavigate2 } from "react-router";
|
|
|
995
995
|
|
|
996
996
|
// src/components/status-bar.tsx
|
|
997
997
|
import { TextAttributes as TextAttributes2 } from "@opentui/core";
|
|
998
|
-
import { Mode as Mode2 } from "@
|
|
998
|
+
import { Mode as Mode2 } from "@nightcodehq/shared";
|
|
999
999
|
import { jsxDEV as jsxDEV9 } from "@opentui/react/jsx-dev-runtime";
|
|
1000
1000
|
function StatusBar() {
|
|
1001
1001
|
const { mode, model } = usePromptConfig();
|
|
@@ -1024,7 +1024,7 @@ function StatusBar() {
|
|
|
1024
1024
|
import { TextAttributes as TextAttributes5 } from "@opentui/core";
|
|
1025
1025
|
|
|
1026
1026
|
// src/components/command-menu/commands.tsx
|
|
1027
|
-
import { SUPPORTED_CHAT_MODELS } from "@
|
|
1027
|
+
import { SUPPORTED_CHAT_MODELS } from "@nightcodehq/shared";
|
|
1028
1028
|
|
|
1029
1029
|
// src/components/dialogs/theme-dialog.tsx
|
|
1030
1030
|
import { useCallback as useCallback7, useEffect, useRef as useRef4 } from "react";
|
|
@@ -1318,7 +1318,7 @@ var SessionsDialogContent = () => {
|
|
|
1318
1318
|
};
|
|
1319
1319
|
// src/components/dialogs/agents-dialog.tsx
|
|
1320
1320
|
import { useCallback as useCallback9 } from "react";
|
|
1321
|
-
import { Mode as Mode3 } from "@
|
|
1321
|
+
import { Mode as Mode3 } from "@nightcodehq/shared";
|
|
1322
1322
|
import { jsxDEV as jsxDEV13 } from "@opentui/react/jsx-dev-runtime";
|
|
1323
1323
|
var AVAILABLE_MODES = [Mode3.BUILD, Mode3.PLAN];
|
|
1324
1324
|
function getModeLabel(mode) {
|
|
@@ -1378,6 +1378,13 @@ var ModelsDialogContent = ({
|
|
|
1378
1378
|
};
|
|
1379
1379
|
// src/lib/oauth.ts
|
|
1380
1380
|
import open from "open";
|
|
1381
|
+
|
|
1382
|
+
// src/config.ts
|
|
1383
|
+
var API_URL = "https://nightcodeserver-production-865b.up.railway.app";
|
|
1384
|
+
var CLERK_FRONTEND_API = "https://known-civet-17.clerk.accounts.dev";
|
|
1385
|
+
var CLERK_OAUTH_CLIENT_ID = "XTe1bnAkoTK61DCg";
|
|
1386
|
+
|
|
1387
|
+
// src/lib/oauth.ts
|
|
1381
1388
|
var LOGIN_TIMEOUT_MS = 5 * 60 * 1000;
|
|
1382
1389
|
function toBase64Url(input) {
|
|
1383
1390
|
return Buffer.from(input).toString("base64url");
|
|
@@ -1400,13 +1407,9 @@ function getErrorMessage2(error) {
|
|
|
1400
1407
|
return error instanceof Error ? error.message : String(error);
|
|
1401
1408
|
}
|
|
1402
1409
|
async function performLogin() {
|
|
1403
|
-
const clerkFrontendApi =
|
|
1404
|
-
const clientId =
|
|
1405
|
-
const apiUrl =
|
|
1406
|
-
if (!clerkFrontendApi)
|
|
1407
|
-
throw new Error("CLERK_FRONTEND_API not set");
|
|
1408
|
-
if (!clientId)
|
|
1409
|
-
throw new Error("CLERK_OAUTH_CLIENT_ID not set");
|
|
1410
|
+
const clerkFrontendApi = CLERK_FRONTEND_API;
|
|
1411
|
+
const clientId = CLERK_OAUTH_CLIENT_ID;
|
|
1412
|
+
const apiUrl = API_URL;
|
|
1410
1413
|
const nonce = crypto.randomUUID();
|
|
1411
1414
|
const codeVerifier = toBase64Url(crypto.getRandomValues(new Uint8Array(32)));
|
|
1412
1415
|
const codeChallenge = await createPkceChallenge(codeVerifier);
|
|
@@ -1816,7 +1819,7 @@ function useCommandMenu() {
|
|
|
1816
1819
|
}
|
|
1817
1820
|
|
|
1818
1821
|
// src/components/input-bar.tsx
|
|
1819
|
-
import { Mode as Mode4 } from "@
|
|
1822
|
+
import { Mode as Mode4 } from "@nightcodehq/shared";
|
|
1820
1823
|
import { jsxDEV as jsxDEV17 } from "@opentui/react/jsx-dev-runtime";
|
|
1821
1824
|
var MAX_VISIBLE_MENTIONS = 8;
|
|
1822
1825
|
var CURRENT_DIRECTORY = process.cwd();
|
|
@@ -2335,7 +2338,7 @@ function Home() {
|
|
|
2335
2338
|
// src/screens/new-session.tsx
|
|
2336
2339
|
import { useEffect as useEffect4, useMemo as useMemo3, useRef as useRef7 } from "react";
|
|
2337
2340
|
import { z } from "zod";
|
|
2338
|
-
import { modeSchema } from "@
|
|
2341
|
+
import { modeSchema } from "@nightcodehq/shared";
|
|
2339
2342
|
import { useNavigate as useNavigate4, useLocation } from "react-router";
|
|
2340
2343
|
|
|
2341
2344
|
// src/components/session-shell.tsx
|
|
@@ -2343,7 +2346,7 @@ import { TextAttributes as TextAttributes8 } from "@opentui/core";
|
|
|
2343
2346
|
|
|
2344
2347
|
// src/components/spinner.tsx
|
|
2345
2348
|
import"opentui-spinner/react";
|
|
2346
|
-
import { Mode as Mode5 } from "@
|
|
2349
|
+
import { Mode as Mode5 } from "@nightcodehq/shared";
|
|
2347
2350
|
import { jsxDEV as jsxDEV19 } from "@opentui/react/jsx-dev-runtime";
|
|
2348
2351
|
function Spinner({ mode = Mode5.BUILD }) {
|
|
2349
2352
|
const { colors } = useTheme();
|
|
@@ -2466,7 +2469,7 @@ function ErrorMessage({ message }) {
|
|
|
2466
2469
|
}, undefined, false, undefined, this);
|
|
2467
2470
|
}
|
|
2468
2471
|
// src/components/messages/user-message.tsx
|
|
2469
|
-
import { Mode as Mode6 } from "@
|
|
2472
|
+
import { Mode as Mode6 } from "@nightcodehq/shared";
|
|
2470
2473
|
import { jsxDEV as jsxDEV22 } from "@opentui/react/jsx-dev-runtime";
|
|
2471
2474
|
function UserMessage({ message, mode }) {
|
|
2472
2475
|
const { colors } = useTheme();
|
|
@@ -2497,7 +2500,7 @@ function UserMessage({ message, mode }) {
|
|
|
2497
2500
|
}
|
|
2498
2501
|
// src/components/messages/bot-message.tsx
|
|
2499
2502
|
import prettyMs from "pretty-ms";
|
|
2500
|
-
import { Mode as Mode7 } from "@
|
|
2503
|
+
import { Mode as Mode7 } from "@nightcodehq/shared";
|
|
2501
2504
|
import { TextAttributes as TextAttributes10 } from "@opentui/core";
|
|
2502
2505
|
import { jsxDEV as jsxDEV23, Fragment as Fragment3 } from "@opentui/react/jsx-dev-runtime";
|
|
2503
2506
|
function formatToolName(name) {
|
|
@@ -2742,7 +2745,7 @@ import {
|
|
|
2742
2745
|
// src/lib/local-tools.ts
|
|
2743
2746
|
import { mkdir, readFile, readdir as readdir2, stat, writeFile } from "fs/promises";
|
|
2744
2747
|
import { dirname, isAbsolute as isAbsolute2, join as join3, relative as relative2, resolve as resolve2 } from "path";
|
|
2745
|
-
import { toolInputSchemas, Mode as Mode9 } from "@
|
|
2748
|
+
import { toolInputSchemas, Mode as Mode9 } from "@nightcodehq/shared";
|
|
2746
2749
|
var MAX_FILE_SIZE = 1e4;
|
|
2747
2750
|
var MAX_RESULTS = 200;
|
|
2748
2751
|
var MAX_MATCHES = 50;
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nightcode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "AI coding assistant for your terminal.",
|
|
5
5
|
"author": "Aman Jaiswal",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
|
|
8
7
|
"homepage": "https://github.com/amanjais123/nightcode",
|
|
9
8
|
"repository": {
|
|
10
9
|
"type": "git",
|
|
@@ -13,7 +12,6 @@
|
|
|
13
12
|
"bugs": {
|
|
14
13
|
"url": "https://github.com/amanjais123/nightcode/issues"
|
|
15
14
|
},
|
|
16
|
-
|
|
17
15
|
"keywords": [
|
|
18
16
|
"ai",
|
|
19
17
|
"cli",
|
|
@@ -24,30 +22,23 @@
|
|
|
24
22
|
"gemini",
|
|
25
23
|
"openai"
|
|
26
24
|
],
|
|
27
|
-
|
|
28
25
|
"type": "module",
|
|
29
|
-
|
|
30
26
|
"main": "./dist/index.js",
|
|
31
27
|
"module": "./dist/index.js",
|
|
32
|
-
|
|
33
28
|
"bin": {
|
|
34
29
|
"nightcode": "./bin/nightcode"
|
|
35
30
|
},
|
|
36
|
-
|
|
37
31
|
"files": [
|
|
38
32
|
"dist",
|
|
39
33
|
"bin"
|
|
40
34
|
],
|
|
41
|
-
|
|
42
35
|
"scripts": {},
|
|
43
|
-
|
|
44
36
|
"peerDependencies": {
|
|
45
37
|
"typescript": "^5"
|
|
46
38
|
},
|
|
47
|
-
|
|
48
39
|
"dependencies": {
|
|
49
40
|
"@ai-sdk/react": "^3.0.186",
|
|
50
|
-
"@nightcodehq/shared": "^1.0.0",
|
|
41
|
+
"@nightcodehq/shared": "^1.0.0",
|
|
51
42
|
"@opentui/core": "^0.1.97",
|
|
52
43
|
"@opentui/react": "^0.1.97",
|
|
53
44
|
"ai": "^6.0.184",
|
|
@@ -60,8 +51,7 @@
|
|
|
60
51
|
"react-router": "^7.14.0",
|
|
61
52
|
"zod": "^4.3.6"
|
|
62
53
|
},
|
|
63
|
-
|
|
64
54
|
"engines": {
|
|
65
55
|
"bun": ">=1.2.0"
|
|
66
56
|
}
|
|
67
|
-
}
|
|
57
|
+
}
|