@limno/next 0.1.0

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/LICENSE.md ADDED
@@ -0,0 +1,110 @@
1
+ # Functional Source License, Version 1.1, MIT Future License
2
+
3
+ ## Abbreviation
4
+
5
+ FSL-1.1-MIT
6
+
7
+ ## Notice
8
+
9
+ Copyright 2026 Damilola Adewale
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the MIT license that is effective on the second anniversary of the date we make
91
+ the Software available. On or after that date, you may use the Software under
92
+ the MIT license, in which case the following will apply:
93
+
94
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
95
+ this software and associated documentation files (the "Software"), to deal in
96
+ the Software without restriction, including without limitation the rights to
97
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
98
+ of the Software, and to permit persons to whom the Software is furnished to do
99
+ so, subject to the following conditions:
100
+
101
+ The above copyright notice and this permission notice shall be included in all
102
+ copies or substantial portions of the Software.
103
+
104
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
105
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
106
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
107
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
108
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
109
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
110
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Adds the Limno editor to the page in `next dev`. Renders nothing, and does nothing in
3
+ * production builds (where `withLimno` provides no LIMNO_URL). Put it once in the root layout.
4
+ */
5
+ declare function Limno(): null;
6
+
7
+ export { Limno, Limno as default };
package/dist/client.js ADDED
@@ -0,0 +1,22 @@
1
+ "use client";
2
+
3
+ // src/client.ts
4
+ import { useEffect } from "react";
5
+ function Limno() {
6
+ if (process.env.NODE_ENV !== "development") return null;
7
+ useEffect(() => {
8
+ const base = process.env.LIMNO_URL;
9
+ if (!base || window.name === "limno-frame" || document.querySelector("script[data-limno]")) return;
10
+ const script = document.createElement("script");
11
+ script.type = "module";
12
+ script.src = `${base}/__limno/overlay.js`;
13
+ script.dataset.limno = "";
14
+ document.body.appendChild(script);
15
+ }, []);
16
+ return null;
17
+ }
18
+ var client_default = Limno;
19
+ export {
20
+ Limno,
21
+ client_default as default
22
+ };
package/dist/index.cjs ADDED
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ default: () => index_default,
34
+ withLimno: () => withLimno
35
+ });
36
+ module.exports = __toCommonJS(index_exports);
37
+
38
+ // ../../node_modules/tsup/assets/cjs_shims.js
39
+ var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
40
+ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
41
+
42
+ // src/index.ts
43
+ var import_node_module = require("module");
44
+ var require2 = (0, import_node_module.createRequire)(importMetaUrl);
45
+ var PHASE_DEVELOPMENT_SERVER = "phase-development-server";
46
+ function withLoader(rules, loader, plainJs) {
47
+ const out = { ...rules ?? {} };
48
+ const globs = plainJs ? ["*.tsx", "*.jsx", "*.js", "*.mjs"] : ["*.tsx", "*.jsx"];
49
+ for (const glob of globs) {
50
+ const existing = out[glob];
51
+ const ours = glob.endsWith("sx") ? {} : { condition: { not: "foreign" } };
52
+ out[glob] = existing && typeof existing === "object" && Array.isArray(existing.loaders) ? { ...existing, loaders: [loader, ...existing.loaders] } : { ...ours, loaders: [loader] };
53
+ }
54
+ return out;
55
+ }
56
+ function nextMajor(root) {
57
+ try {
58
+ const pkg = (0, import_node_module.createRequire)(`${root}/package.json`)("next/package.json");
59
+ return parseInt(pkg.version, 10) || 0;
60
+ } catch {
61
+ return 0;
62
+ }
63
+ }
64
+ function withLimno(config = {}, options = {}) {
65
+ return async (phase, ctx) => {
66
+ const base = typeof config === "function" ? await config(phase, ctx) : config;
67
+ if (phase !== PHASE_DEVELOPMENT_SERVER) return base;
68
+ const root = options.root ?? process.cwd();
69
+ let url;
70
+ try {
71
+ const { startServer } = await import("@limno/core");
72
+ url = (await startServer({ root, dir: options.dir })).url;
73
+ } catch (err) {
74
+ console.warn(`[limno] Couldn't start Limno's dev server; continuing without it. ${err instanceof Error ? err.message : err}`);
75
+ return base;
76
+ }
77
+ const loader = { loader: require2.resolve("@limno/core/loader"), options: { root } };
78
+ return {
79
+ ...base,
80
+ env: { ...base.env, LIMNO_URL: url },
81
+ turbopack: { ...base.turbopack, rules: withLoader(base.turbopack?.rules, loader, nextMajor(root) >= 16) },
82
+ webpack(cfg, opts) {
83
+ cfg.module.rules.unshift({ test: /\.(jsx|tsx|js|mjs)$/, exclude: /[\\/]node_modules[\\/]/, enforce: "pre", use: [loader] });
84
+ return typeof base.webpack === "function" ? base.webpack(cfg, opts) : cfg;
85
+ }
86
+ };
87
+ };
88
+ }
89
+ var index_default = withLimno;
90
+ // Annotate the CommonJS export names for ESM import in node:
91
+ 0 && (module.exports = {
92
+ withLimno
93
+ });
@@ -0,0 +1,15 @@
1
+ interface LimnoNextOptions {
2
+ /** Directory (relative to the project) for change sets. Default ".limno". */
3
+ dir?: string;
4
+ /** Project root. Default: the directory `next dev` runs in. */
5
+ root?: string;
6
+ }
7
+ type NextConfig = {
8
+ [key: string]: any;
9
+ };
10
+ type NextConfigFn = (phase: string, ctx: {
11
+ defaultConfig: NextConfig;
12
+ }) => NextConfig | Promise<NextConfig>;
13
+ declare function withLimno(config?: NextConfig | NextConfigFn, options?: LimnoNextOptions): NextConfigFn;
14
+
15
+ export { type LimnoNextOptions, withLimno as default, withLimno };
@@ -0,0 +1,15 @@
1
+ interface LimnoNextOptions {
2
+ /** Directory (relative to the project) for change sets. Default ".limno". */
3
+ dir?: string;
4
+ /** Project root. Default: the directory `next dev` runs in. */
5
+ root?: string;
6
+ }
7
+ type NextConfig = {
8
+ [key: string]: any;
9
+ };
10
+ type NextConfigFn = (phase: string, ctx: {
11
+ defaultConfig: NextConfig;
12
+ }) => NextConfig | Promise<NextConfig>;
13
+ declare function withLimno(config?: NextConfig | NextConfigFn, options?: LimnoNextOptions): NextConfigFn;
14
+
15
+ export { type LimnoNextOptions, withLimno as default, withLimno };
package/dist/index.js ADDED
@@ -0,0 +1,52 @@
1
+ // src/index.ts
2
+ import { createRequire } from "module";
3
+ var require2 = createRequire(import.meta.url);
4
+ var PHASE_DEVELOPMENT_SERVER = "phase-development-server";
5
+ function withLoader(rules, loader, plainJs) {
6
+ const out = { ...rules ?? {} };
7
+ const globs = plainJs ? ["*.tsx", "*.jsx", "*.js", "*.mjs"] : ["*.tsx", "*.jsx"];
8
+ for (const glob of globs) {
9
+ const existing = out[glob];
10
+ const ours = glob.endsWith("sx") ? {} : { condition: { not: "foreign" } };
11
+ out[glob] = existing && typeof existing === "object" && Array.isArray(existing.loaders) ? { ...existing, loaders: [loader, ...existing.loaders] } : { ...ours, loaders: [loader] };
12
+ }
13
+ return out;
14
+ }
15
+ function nextMajor(root) {
16
+ try {
17
+ const pkg = createRequire(`${root}/package.json`)("next/package.json");
18
+ return parseInt(pkg.version, 10) || 0;
19
+ } catch {
20
+ return 0;
21
+ }
22
+ }
23
+ function withLimno(config = {}, options = {}) {
24
+ return async (phase, ctx) => {
25
+ const base = typeof config === "function" ? await config(phase, ctx) : config;
26
+ if (phase !== PHASE_DEVELOPMENT_SERVER) return base;
27
+ const root = options.root ?? process.cwd();
28
+ let url;
29
+ try {
30
+ const { startServer } = await import("@limno/core");
31
+ url = (await startServer({ root, dir: options.dir })).url;
32
+ } catch (err) {
33
+ console.warn(`[limno] Couldn't start Limno's dev server; continuing without it. ${err instanceof Error ? err.message : err}`);
34
+ return base;
35
+ }
36
+ const loader = { loader: require2.resolve("@limno/core/loader"), options: { root } };
37
+ return {
38
+ ...base,
39
+ env: { ...base.env, LIMNO_URL: url },
40
+ turbopack: { ...base.turbopack, rules: withLoader(base.turbopack?.rules, loader, nextMajor(root) >= 16) },
41
+ webpack(cfg, opts) {
42
+ cfg.module.rules.unshift({ test: /\.(jsx|tsx|js|mjs)$/, exclude: /[\\/]node_modules[\\/]/, enforce: "pre", use: [loader] });
43
+ return typeof base.webpack === "function" ? base.webpack(cfg, opts) : cfg;
44
+ }
45
+ };
46
+ };
47
+ }
48
+ var index_default = withLimno;
49
+ export {
50
+ index_default as default,
51
+ withLimno
52
+ };
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@limno/next",
3
+ "version": "0.1.0",
4
+ "description": "Limno for Next.js: edit your running app visually and hand exact changes to your coding agent.",
5
+ "license": "FSL-1.1-MIT",
6
+ "type": "module",
7
+ "main": "./dist/index.cjs",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ },
15
+ "./client": {
16
+ "types": "./dist/client.d.ts",
17
+ "import": "./dist/client.js"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/armie3/limno.git",
26
+ "directory": "packages/next"
27
+ },
28
+ "homepage": "https://github.com/armie3/limno#readme",
29
+ "keywords": [
30
+ "limno",
31
+ "nextjs",
32
+ "design",
33
+ "visual-editing",
34
+ "coding-agent",
35
+ "mcp"
36
+ ],
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "engines": {
41
+ "node": ">=20"
42
+ },
43
+ "scripts": {
44
+ "build": "tsup"
45
+ },
46
+ "dependencies": {
47
+ "@limno/core": "0.1.0"
48
+ },
49
+ "peerDependencies": {
50
+ "next": ">=14",
51
+ "react": ">=18"
52
+ },
53
+ "devDependencies": {
54
+ "@types/react": "^19.2.0"
55
+ }
56
+ }