iris-chatbot 0.2.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.
Files changed (66) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -0
  3. package/bin/iris.mjs +267 -0
  4. package/package.json +61 -0
  5. package/template/LICENSE +21 -0
  6. package/template/README.md +49 -0
  7. package/template/eslint.config.mjs +18 -0
  8. package/template/next.config.ts +7 -0
  9. package/template/package-lock.json +9193 -0
  10. package/template/package.json +46 -0
  11. package/template/postcss.config.mjs +7 -0
  12. package/template/public/file.svg +1 -0
  13. package/template/public/globe.svg +1 -0
  14. package/template/public/next.svg +1 -0
  15. package/template/public/vercel.svg +1 -0
  16. package/template/public/window.svg +1 -0
  17. package/template/src/app/api/chat/route.ts +2445 -0
  18. package/template/src/app/api/connections/models/route.ts +255 -0
  19. package/template/src/app/api/connections/test/route.ts +124 -0
  20. package/template/src/app/api/local-sync/route.ts +74 -0
  21. package/template/src/app/api/tool-approval/route.ts +47 -0
  22. package/template/src/app/favicon.ico +0 -0
  23. package/template/src/app/globals.css +808 -0
  24. package/template/src/app/layout.tsx +74 -0
  25. package/template/src/app/page.tsx +444 -0
  26. package/template/src/components/ChatView.tsx +1537 -0
  27. package/template/src/components/Composer.tsx +160 -0
  28. package/template/src/components/MapView.tsx +244 -0
  29. package/template/src/components/MessageCard.tsx +955 -0
  30. package/template/src/components/SearchModal.tsx +72 -0
  31. package/template/src/components/SettingsModal.tsx +1257 -0
  32. package/template/src/components/Sidebar.tsx +153 -0
  33. package/template/src/components/TopBar.tsx +164 -0
  34. package/template/src/lib/connections.ts +275 -0
  35. package/template/src/lib/data.ts +324 -0
  36. package/template/src/lib/db.ts +49 -0
  37. package/template/src/lib/hooks.ts +76 -0
  38. package/template/src/lib/local-sync.ts +192 -0
  39. package/template/src/lib/memory.ts +695 -0
  40. package/template/src/lib/model-presets.ts +251 -0
  41. package/template/src/lib/store.ts +36 -0
  42. package/template/src/lib/tooling/approvals.ts +78 -0
  43. package/template/src/lib/tooling/providers/anthropic.ts +155 -0
  44. package/template/src/lib/tooling/providers/ollama.ts +73 -0
  45. package/template/src/lib/tooling/providers/openai.ts +267 -0
  46. package/template/src/lib/tooling/providers/openai_compatible.ts +16 -0
  47. package/template/src/lib/tooling/providers/types.ts +44 -0
  48. package/template/src/lib/tooling/registry.ts +103 -0
  49. package/template/src/lib/tooling/runtime.ts +189 -0
  50. package/template/src/lib/tooling/safety.ts +165 -0
  51. package/template/src/lib/tooling/tools/apps.ts +108 -0
  52. package/template/src/lib/tooling/tools/apps_plus.ts +153 -0
  53. package/template/src/lib/tooling/tools/communication.ts +883 -0
  54. package/template/src/lib/tooling/tools/files.ts +395 -0
  55. package/template/src/lib/tooling/tools/music.ts +988 -0
  56. package/template/src/lib/tooling/tools/notes.ts +461 -0
  57. package/template/src/lib/tooling/tools/notes_plus.ts +294 -0
  58. package/template/src/lib/tooling/tools/numbers.ts +175 -0
  59. package/template/src/lib/tooling/tools/schedule.ts +579 -0
  60. package/template/src/lib/tooling/tools/system.ts +142 -0
  61. package/template/src/lib/tooling/tools/web.ts +212 -0
  62. package/template/src/lib/tooling/tools/workflow.ts +218 -0
  63. package/template/src/lib/tooling/types.ts +27 -0
  64. package/template/src/lib/types.ts +309 -0
  65. package/template/src/lib/utils.ts +108 -0
  66. package/template/tsconfig.json +34 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 qwerty2777
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # Iris CLI Installer
2
+
3
+ One command creates a fresh Iris project in `./iris` and installs dependencies:
4
+
5
+ ```bash
6
+ npx iris-chatbot@latest
7
+ ```
8
+
9
+ ## Requirements
10
+
11
+ - Node.js `>=20.9.0`
12
+
13
+ ## What The Command Does
14
+
15
+ When you run `npx iris-chatbot@latest`:
16
+
17
+ 1. Creates a new folder named `iris` in your current directory
18
+ 2. Copies the project template into it
19
+ 3. Installs dependencies automatically
20
+
21
+ If an `iris` directory already exists, the command fails and does not overwrite files.
22
+
23
+ ## Optional Flags
24
+
25
+ ```bash
26
+ npx iris-chatbot@latest --skip-install
27
+ npx iris-chatbot@latest --pm pnpm
28
+ npx iris-chatbot@latest --yes
29
+ ```
30
+
31
+ - `--skip-install`: scaffold files only
32
+ - `--pm <npm|pnpm|yarn|bun>`: choose package manager for dependency install
33
+ - `--yes`: non-interactive mode compatibility flag
34
+
35
+ ## Compatibility Alias
36
+
37
+ Legacy/advanced path is still supported:
38
+
39
+ ```bash
40
+ npx iris-chatbot@latest init my-app
41
+ ```
42
+
43
+ ## Local Development (This Repository)
44
+
45
+ To work on the installer and app source directly in this repo:
46
+
47
+ ```bash
48
+ npm run dev
49
+ ```
package/bin/iris.mjs ADDED
@@ -0,0 +1,267 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawn } from "node:child_process";
4
+ import { promises as fs } from "node:fs";
5
+ import path from "node:path";
6
+ import process from "node:process";
7
+ import { fileURLToPath } from "node:url";
8
+
9
+ const SUPPORTED_PACKAGE_MANAGERS = new Set(["npm", "pnpm", "yarn", "bun"]);
10
+
11
+ function printUsage() {
12
+ console.log(
13
+ [
14
+ "Usage:",
15
+ " iris-chatbot [--skip-install] [--pm <npm|pnpm|yarn|bun>] [--yes]",
16
+ " iris-chatbot init [directory] [--skip-install] [--pm <npm|pnpm|yarn|bun>] [--yes]",
17
+ "",
18
+ "Default behavior:",
19
+ " - With no positional args, creates ./iris",
20
+ " - Fails if target directory already exists",
21
+ " - Installs dependencies unless --skip-install is set",
22
+ ].join("\n"),
23
+ );
24
+ }
25
+
26
+ function parseArgs(argv) {
27
+ const options = {
28
+ skipInstall: false,
29
+ yes: false,
30
+ pm: "npm",
31
+ };
32
+ const positional = [];
33
+
34
+ for (let i = 0; i < argv.length; i += 1) {
35
+ const arg = argv[i];
36
+
37
+ if (arg === "--help" || arg === "-h") {
38
+ options.help = true;
39
+ continue;
40
+ }
41
+ if (arg === "--skip-install") {
42
+ options.skipInstall = true;
43
+ continue;
44
+ }
45
+ if (arg === "--yes") {
46
+ options.yes = true;
47
+ continue;
48
+ }
49
+ if (arg === "--pm") {
50
+ const next = argv[i + 1];
51
+ if (!next) {
52
+ throw new Error("Missing value for --pm. Expected one of: npm, pnpm, yarn, bun.");
53
+ }
54
+ options.pm = next;
55
+ i += 1;
56
+ continue;
57
+ }
58
+ if (arg.startsWith("--pm=")) {
59
+ options.pm = arg.slice("--pm=".length);
60
+ continue;
61
+ }
62
+ if (arg.startsWith("-")) {
63
+ throw new Error(`Unknown option: ${arg}`);
64
+ }
65
+
66
+ positional.push(arg);
67
+ }
68
+
69
+ if (!SUPPORTED_PACKAGE_MANAGERS.has(options.pm)) {
70
+ throw new Error(
71
+ `Unsupported package manager "${options.pm}". Use one of: npm, pnpm, yarn, bun.`,
72
+ );
73
+ }
74
+
75
+ return { options, positional };
76
+ }
77
+
78
+ function resolveTargetDirectory(positional) {
79
+ if (positional.length === 0) {
80
+ return "iris";
81
+ }
82
+
83
+ if (positional[0] === "init") {
84
+ if (positional.length === 1) {
85
+ return "iris";
86
+ }
87
+ if (positional.length === 2) {
88
+ return positional[1];
89
+ }
90
+ throw new Error("Too many positional arguments. Use: iris-chatbot init [directory]");
91
+ }
92
+
93
+ throw new Error(
94
+ `Unknown command: ${positional[0]}. Use no args for default install or: iris-chatbot init [directory]`,
95
+ );
96
+ }
97
+
98
+ function normalizePackageName(input) {
99
+ const lowered = input.trim().toLowerCase();
100
+ const compact = lowered
101
+ .replace(/[^a-z0-9._-]+/g, "-")
102
+ .replace(/^-+/, "")
103
+ .replace(/-+$/, "");
104
+
105
+ let candidate = compact || "iris";
106
+ if (/^[._]/.test(candidate)) {
107
+ candidate = `iris-${candidate.replace(/^[._-]+/, "")}`;
108
+ }
109
+ if (!/^[a-z0-9]/.test(candidate)) {
110
+ candidate = `iris-${candidate}`;
111
+ }
112
+ if (!candidate) {
113
+ return "iris";
114
+ }
115
+ return candidate;
116
+ }
117
+
118
+ async function pathExists(targetPath) {
119
+ try {
120
+ await fs.access(targetPath);
121
+ return true;
122
+ } catch {
123
+ return false;
124
+ }
125
+ }
126
+
127
+ async function updateManifestNames(targetDir) {
128
+ const folderName = path.basename(targetDir);
129
+ const packageName = normalizePackageName(folderName);
130
+
131
+ const packageJsonPath = path.join(targetDir, "package.json");
132
+ if (await pathExists(packageJsonPath)) {
133
+ const packageJsonRaw = await fs.readFile(packageJsonPath, "utf8");
134
+ const packageJson = JSON.parse(packageJsonRaw);
135
+ packageJson.name = packageName;
136
+ packageJson.private = true;
137
+ delete packageJson.bin;
138
+ delete packageJson.files;
139
+ delete packageJson.publishConfig;
140
+ if (packageJson.scripts && typeof packageJson.scripts === "object") {
141
+ delete packageJson.scripts["sync:template"];
142
+ delete packageJson.scripts["verify:pack"];
143
+ delete packageJson.scripts.prepack;
144
+ }
145
+ await fs.writeFile(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`, "utf8");
146
+ }
147
+
148
+ const packageLockPath = path.join(targetDir, "package-lock.json");
149
+ if (await pathExists(packageLockPath)) {
150
+ const lockRaw = await fs.readFile(packageLockPath, "utf8");
151
+ const lockJson = JSON.parse(lockRaw);
152
+ lockJson.name = packageName;
153
+ if (lockJson.packages && lockJson.packages[""] && typeof lockJson.packages[""] === "object") {
154
+ lockJson.packages[""].name = packageName;
155
+ }
156
+ await fs.writeFile(packageLockPath, `${JSON.stringify(lockJson, null, 2)}\n`, "utf8");
157
+ }
158
+ }
159
+
160
+ function installArgsForPackageManager(pm) {
161
+ if (pm === "npm") {
162
+ return ["install"];
163
+ }
164
+ if (pm === "pnpm") {
165
+ return ["install"];
166
+ }
167
+ if (pm === "yarn") {
168
+ return ["install"];
169
+ }
170
+ return ["install"];
171
+ }
172
+
173
+ async function runInstall(pm, cwd) {
174
+ const args = installArgsForPackageManager(pm);
175
+
176
+ await new Promise((resolve, reject) => {
177
+ const child = spawn(pm, args, {
178
+ cwd,
179
+ stdio: "inherit",
180
+ shell: process.platform === "win32",
181
+ });
182
+
183
+ child.on("error", (error) => {
184
+ if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
185
+ reject(new Error(`Package manager "${pm}" is not installed or not on PATH.`));
186
+ return;
187
+ }
188
+ reject(error);
189
+ });
190
+
191
+ child.on("exit", (code) => {
192
+ if (code === 0) {
193
+ resolve();
194
+ return;
195
+ }
196
+ reject(new Error(`Dependency installation failed with exit code ${code ?? "unknown"}.`));
197
+ });
198
+ });
199
+ }
200
+
201
+ function devCommandForPackageManager(pm) {
202
+ if (pm === "pnpm") {
203
+ return "pnpm dev";
204
+ }
205
+ if (pm === "yarn") {
206
+ return "yarn dev";
207
+ }
208
+ if (pm === "bun") {
209
+ return "bun run dev";
210
+ }
211
+ return "npm run dev";
212
+ }
213
+
214
+ async function main() {
215
+ const { options, positional } = parseArgs(process.argv.slice(2));
216
+
217
+ if (options.help) {
218
+ printUsage();
219
+ return;
220
+ }
221
+
222
+ const targetArg = resolveTargetDirectory(positional);
223
+ if (!targetArg || !targetArg.trim()) {
224
+ throw new Error("Target directory name cannot be empty.");
225
+ }
226
+
227
+ const targetDir = path.resolve(process.cwd(), targetArg);
228
+
229
+ if (await pathExists(targetDir)) {
230
+ throw new Error(
231
+ `Target directory already exists: ${targetDir}\n` +
232
+ "Remove or rename that folder, then run the command again.",
233
+ );
234
+ }
235
+
236
+ const cliDir = path.dirname(fileURLToPath(import.meta.url));
237
+ const packageRoot = path.resolve(cliDir, "..");
238
+ const templateDir = path.join(packageRoot, "template");
239
+
240
+ if (!(await pathExists(templateDir))) {
241
+ throw new Error("Template payload is missing from this package.");
242
+ }
243
+
244
+ console.log(`Creating project in ${targetDir}`);
245
+ await fs.cp(templateDir, targetDir, {
246
+ recursive: true,
247
+ force: false,
248
+ errorOnExist: true,
249
+ });
250
+
251
+ await updateManifestNames(targetDir);
252
+
253
+ if (!options.skipInstall) {
254
+ console.log(`Installing dependencies using ${options.pm}...`);
255
+ await runInstall(options.pm, targetDir);
256
+ }
257
+
258
+ const relativeTargetDir = path.relative(process.cwd(), targetDir) || ".";
259
+ console.log("\nDone. Next steps:");
260
+ console.log(` cd ${relativeTargetDir}`);
261
+ console.log(` ${devCommandForPackageManager(options.pm)}`);
262
+ }
263
+
264
+ main().catch((error) => {
265
+ console.error(`\nError: ${error instanceof Error ? error.message : String(error)}`);
266
+ process.exit(1);
267
+ });
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "iris-chatbot",
3
+ "version": "0.2.4",
4
+ "private": false,
5
+ "description": "One-command installer for the Iris project template.",
6
+ "bin": {
7
+ "iris-chatbot": "bin/iris.mjs"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "template",
12
+ "LICENSE",
13
+ "README.md"
14
+ ],
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "engines": {
19
+ "node": ">=20.9.0"
20
+ },
21
+ "scripts": {
22
+ "dev": "next dev",
23
+ "build": "next build",
24
+ "start": "next start",
25
+ "lint": "eslint",
26
+ "sync:template": "node scripts/sync-template.mjs",
27
+ "verify:pack": "node scripts/verify-pack.mjs",
28
+ "prepack": "npm run sync:template && npm run verify:pack"
29
+ },
30
+ "dependencies": {
31
+ "@anthropic-ai/sdk": "^0.72.1",
32
+ "clsx": "^2.1.1",
33
+ "dagre": "^0.8.5",
34
+ "dexie": "^4.3.0",
35
+ "dexie-react-hooks": "^4.2.0",
36
+ "katex": "^0.16.28",
37
+ "lucide-react": "^0.563.0",
38
+ "nanoid": "^5.1.6",
39
+ "next": "16.1.6",
40
+ "openai": "^6.18.0",
41
+ "react": "19.2.3",
42
+ "react-dom": "19.2.3",
43
+ "react-markdown": "^10.1.0",
44
+ "reactflow": "^11.11.4",
45
+ "rehype-katex": "^7.0.1",
46
+ "remark-gfm": "^4.0.1",
47
+ "remark-math": "^6.0.0",
48
+ "zustand": "^5.0.11"
49
+ },
50
+ "devDependencies": {
51
+ "@tailwindcss/postcss": "^4",
52
+ "@types/dagre": "^0.7.53",
53
+ "@types/node": "^20",
54
+ "@types/react": "^19",
55
+ "@types/react-dom": "^19",
56
+ "eslint": "^9",
57
+ "eslint-config-next": "16.1.6",
58
+ "tailwindcss": "^4",
59
+ "typescript": "^5"
60
+ }
61
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 qwerty2777
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,49 @@
1
+ # Iris CLI Installer
2
+
3
+ One command creates a fresh Iris project in `./iris` and installs dependencies:
4
+
5
+ ```bash
6
+ npx iris-chatbot@latest
7
+ ```
8
+
9
+ ## Requirements
10
+
11
+ - Node.js `>=20.9.0`
12
+
13
+ ## What The Command Does
14
+
15
+ When you run `npx iris-chatbot@latest`:
16
+
17
+ 1. Creates a new folder named `iris` in your current directory
18
+ 2. Copies the project template into it
19
+ 3. Installs dependencies automatically
20
+
21
+ If an `iris` directory already exists, the command fails and does not overwrite files.
22
+
23
+ ## Optional Flags
24
+
25
+ ```bash
26
+ npx iris-chatbot@latest --skip-install
27
+ npx iris-chatbot@latest --pm pnpm
28
+ npx iris-chatbot@latest --yes
29
+ ```
30
+
31
+ - `--skip-install`: scaffold files only
32
+ - `--pm <npm|pnpm|yarn|bun>`: choose package manager for dependency install
33
+ - `--yes`: non-interactive mode compatibility flag
34
+
35
+ ## Compatibility Alias
36
+
37
+ Legacy/advanced path is still supported:
38
+
39
+ ```bash
40
+ npx iris-chatbot@latest init my-app
41
+ ```
42
+
43
+ ## Local Development (This Repository)
44
+
45
+ To work on the installer and app source directly in this repo:
46
+
47
+ ```bash
48
+ npm run dev
49
+ ```
@@ -0,0 +1,18 @@
1
+ import { defineConfig, globalIgnores } from "eslint/config";
2
+ import nextVitals from "eslint-config-next/core-web-vitals";
3
+ import nextTs from "eslint-config-next/typescript";
4
+
5
+ const eslintConfig = defineConfig([
6
+ ...nextVitals,
7
+ ...nextTs,
8
+ // Override default ignores of eslint-config-next.
9
+ globalIgnores([
10
+ // Default ignores of eslint-config-next:
11
+ ".next/**",
12
+ "out/**",
13
+ "build/**",
14
+ "next-env.d.ts",
15
+ ]),
16
+ ]);
17
+
18
+ export default eslintConfig;
@@ -0,0 +1,7 @@
1
+ import type { NextConfig } from "next";
2
+
3
+ const nextConfig: NextConfig = {
4
+ devIndicators: false,
5
+ };
6
+
7
+ export default nextConfig;