new update
This commit is contained in:
+16
-1
@@ -1,6 +1,21 @@
|
|||||||
--- HIGH PRIORITY
|
--- VERY HIGH PRIORITY:
|
||||||
|
|
||||||
|
Update pfp composer when new upload.actually i have to refresh the page after the save button for seeing it
|
||||||
|
when upload did we have to refresh the pfp preview composer to the new uploaded pictures.
|
||||||
|
|
||||||
|
|
||||||
|
--- MEDIUM PRIORITY
|
||||||
Being abble to :
|
Being abble to :
|
||||||
Disable features / Enable it:
|
Disable features / Enable it:
|
||||||
ie : thinking, deep search, etc...
|
ie : thinking, deep search, etc...
|
||||||
|
|
||||||
Downloading models throught a catalog : ollama only
|
Downloading models throught a catalog : ollama only
|
||||||
|
|
||||||
|
|
||||||
|
--- LOW PRIORITY
|
||||||
|
|
||||||
|
Search into the old prompts with a search bar.
|
||||||
|
integrate the platform name in the top of the conversations slide list. with a well beautiful font and a flower in lucide svg icon for the brand icon
|
||||||
|
|
||||||
|
Make a beautiful SEO integrate into the html file for disovering.
|
||||||
|
make a robots.txt file for let all llm/crawler/scrapper visiting the site.
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
'';
|
'';
|
||||||
outputHashAlgo = "sha256";
|
outputHashAlgo = "sha256";
|
||||||
outputHashMode = "recursive";
|
outputHashMode = "recursive";
|
||||||
outputHash = "sha256-0AhK5sK0FmqxTb1kedUDPH9aOiYKN7z1jWQVFsnb1hs=";
|
outputHash = "sha256-ToEgXq9TpyliuZn+0bu+95SUER+tuXLJ0LHY+c6LUXE=";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Phase 2 (offline): vite build against the pre-fetched node_modules.
|
# Phase 2 (offline): vite build against the pre-fetched node_modules.
|
||||||
@@ -40,15 +40,17 @@
|
|||||||
pname = "kisassistant-frontend";
|
pname = "kisassistant-frontend";
|
||||||
inherit version;
|
inherit version;
|
||||||
src = ./frontend;
|
src = ./frontend;
|
||||||
nativeBuildInputs = [ pkgs.bun ];
|
nativeBuildInputs = [ pkgs.bun pkgs.nodejs ];
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
export HOME=$TMPDIR
|
export HOME=$TMPDIR
|
||||||
ln -s ${bunDeps} node_modules
|
cp -a ${bunDeps} node_modules
|
||||||
|
chmod -R u+w node_modules
|
||||||
|
patchShebangs node_modules
|
||||||
bun run build
|
bun run build
|
||||||
'';
|
'';
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
cp -r dist/* $out/
|
cp -r ../public/. $out/
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in pkgs.stdenv.mkDerivation {
|
in pkgs.stdenv.mkDerivation {
|
||||||
|
|||||||
@@ -58,11 +58,25 @@ export function Sidebar({
|
|||||||
}) {
|
}) {
|
||||||
const [menu, setMenu] = useState<MenuState | null>(null);
|
const [menu, setMenu] = useState<MenuState | null>(null);
|
||||||
const touchX = useRef<number | null>(null);
|
const touchX = useRef<number | null>(null);
|
||||||
|
// Long-press (mobile right-click): open the context menu, suppress the tap.
|
||||||
|
const pressTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||||
|
const pressPos = useRef<{ x: number; y: number } | null>(null);
|
||||||
|
const suppressClick = useRef(false);
|
||||||
|
|
||||||
|
function openMenuAt(x: number, y: number, conv: Conversation) {
|
||||||
|
setMenu({ x, y, conv });
|
||||||
|
}
|
||||||
|
|
||||||
function openMenu(e: React.MouseEvent, conv: Conversation) {
|
function openMenu(e: React.MouseEvent, conv: Conversation) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
setMenu({ x: e.clientX, y: e.clientY, conv });
|
openMenuAt(e.clientX, e.clientY, conv);
|
||||||
|
}
|
||||||
|
|
||||||
|
function cancelPress() {
|
||||||
|
if (pressTimer.current) clearTimeout(pressTimer.current);
|
||||||
|
pressTimer.current = null;
|
||||||
|
pressPos.current = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (collapsed && !mobileOpen) return null;
|
if (collapsed && !mobileOpen) return null;
|
||||||
@@ -110,9 +124,29 @@ export function Sidebar({
|
|||||||
key={c.id}
|
key={c.id}
|
||||||
role="button"
|
role="button"
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
onClick={() => onSelect(c.id)}
|
onClick={() => {
|
||||||
|
if (suppressClick.current) {
|
||||||
|
suppressClick.current = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
onSelect(c.id);
|
||||||
|
}}
|
||||||
onKeyDown={(e) => e.key === "Enter" && onSelect(c.id)}
|
onKeyDown={(e) => e.key === "Enter" && onSelect(c.id)}
|
||||||
onContextMenu={(e) => openMenu(e, c)}
|
onContextMenu={(e) => openMenu(e, c)}
|
||||||
|
onTouchStart={(e) => {
|
||||||
|
const t = e.touches[0]!;
|
||||||
|
pressPos.current = { x: t.clientX, y: t.clientY };
|
||||||
|
pressTimer.current = setTimeout(() => {
|
||||||
|
suppressClick.current = true;
|
||||||
|
openMenuAt(t.clientX, t.clientY, c);
|
||||||
|
}, 550);
|
||||||
|
}}
|
||||||
|
onTouchMove={(e) => {
|
||||||
|
const p = pressPos.current;
|
||||||
|
const t = e.touches[0]!;
|
||||||
|
if (p && Math.hypot(t.clientX - p.x, t.clientY - p.y) > 10) cancelPress();
|
||||||
|
}}
|
||||||
|
onTouchEnd={cancelPress}
|
||||||
className={cn(
|
className={cn(
|
||||||
"group flex cursor-pointer items-center gap-2 rounded-2xl px-3 py-2.5 text-sm transition",
|
"group flex cursor-pointer items-center gap-2 rounded-2xl px-3 py-2.5 text-sm transition",
|
||||||
c.id === activeId
|
c.id === activeId
|
||||||
|
|||||||
+38
-5
@@ -1,13 +1,23 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.services.kisassistant;
|
cfg = config.services.kisassistant;
|
||||||
|
|
||||||
|
# Backward-compatible tri-state: null (default) keeps the legacy behaviour
|
||||||
|
# (setting `domain` activates nginx), true forces it on, false forces it off.
|
||||||
|
nginxEnabled =
|
||||||
|
if cfg.enableNginx != null then cfg.enableNginx
|
||||||
|
else cfg.domain != null;
|
||||||
in {
|
in {
|
||||||
options.services.kisassistant = {
|
options.services.kisassistant = {
|
||||||
enable = lib.mkEnableOption "KisAssistant private chat assistant";
|
enable = lib.mkEnableOption "KisAssistant private chat assistant";
|
||||||
package = lib.mkOption {
|
package = lib.mkOption {
|
||||||
type = lib.types.package;
|
type = lib.types.nullOr lib.types.package;
|
||||||
default = pkgs.bun;
|
default = null;
|
||||||
description = "KisAssistant package built from this flake (set via nixpkgs overlay or flake packages output).";
|
description = ''
|
||||||
|
KisAssistant package built from this flake, e.g.
|
||||||
|
`kisassistant.packages.''${pkgs.system}.default`.
|
||||||
|
Required when the service is enabled.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
port = lib.mkOption { type = lib.types.port; default = 3000; };
|
port = lib.mkOption { type = lib.types.port; default = 3000; };
|
||||||
host = lib.mkOption { type = lib.types.str; default = "127.0.0.1"; };
|
host = lib.mkOption { type = lib.types.str; default = "127.0.0.1"; };
|
||||||
@@ -22,7 +32,17 @@ in {
|
|||||||
domain = lib.mkOption {
|
domain = lib.mkOption {
|
||||||
type = lib.types.nullOr lib.types.str;
|
type = lib.types.nullOr lib.types.str;
|
||||||
default = null;
|
default = null;
|
||||||
description = "e.g. chat.kisakay.com — enables bundled nginx reverse proxy.";
|
description = "nginx virtualHost name (e.g. chat.kisakay.com). Required when enableNginx is true.";
|
||||||
|
};
|
||||||
|
enableNginx = lib.mkOption {
|
||||||
|
type = lib.types.nullOr lib.types.bool;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Reverse-proxy the service through nginx with TLS + ACME.
|
||||||
|
- `true`: nginx is configured (requires `domain`).
|
||||||
|
- `false`: nginx is never configured, even if `domain` is set.
|
||||||
|
- `null` (default): legacy behaviour — nginx is configured iff `domain` is set.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
extraEnv = lib.mkOption {
|
extraEnv = lib.mkOption {
|
||||||
type = lib.types.attrsOf lib.types.str;
|
type = lib.types.attrsOf lib.types.str;
|
||||||
@@ -32,6 +52,17 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = cfg.package != null;
|
||||||
|
message = "services.kisassistant.package must be set, e.g. kisassistant.packages.\${pkgs.system}.default";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
assertion = !(nginxEnabled && cfg.domain == null);
|
||||||
|
message = "services.kisassistant.enableNginx requires services.kisassistant.domain to be set";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
users.users.${cfg.user} = {
|
users.users.${cfg.user} = {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = cfg.user;
|
group = cfg.user;
|
||||||
@@ -47,8 +78,10 @@ in {
|
|||||||
environment = {
|
environment = {
|
||||||
PORT = toString cfg.port;
|
PORT = toString cfg.port;
|
||||||
HOST = cfg.host;
|
HOST = cfg.host;
|
||||||
|
NODE_ENV = "production";
|
||||||
DATA_DIR = "${cfg.dataDir}/data";
|
DATA_DIR = "${cfg.dataDir}/data";
|
||||||
CDN_DIR = "${cfg.dataDir}/cdn";
|
CDN_DIR = "${cfg.dataDir}/cdn";
|
||||||
|
DRIVER_DEBUG = "false";
|
||||||
OLLAMA_HOST = cfg.ollamaHost;
|
OLLAMA_HOST = cfg.ollamaHost;
|
||||||
} // cfg.extraEnv;
|
} // cfg.extraEnv;
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
@@ -68,7 +101,7 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx = lib.mkIf (cfg.domain != null) {
|
services.nginx = lib.mkIf nginxEnabled {
|
||||||
enable = true;
|
enable = true;
|
||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
virtualHosts.${cfg.domain} = {
|
virtualHosts.${cfg.domain} = {
|
||||||
|
|||||||
Reference in New Issue
Block a user