@chosengeneration/light-code 0.67.0 → 0.68.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/dist/cli.js +18 -2
- package/dist/server.js +10 -1
- package/package.json +65 -65
package/dist/cli.js
CHANGED
|
@@ -69729,6 +69729,10 @@ function checkRequest(request, policy, options) {
|
|
|
69729
69729
|
}
|
|
69730
69730
|
return void 0;
|
|
69731
69731
|
}
|
|
69732
|
+
var frameAncestors = [];
|
|
69733
|
+
function setFrameAncestors(origins) {
|
|
69734
|
+
frameAncestors = origins.map((origin) => origin.trim()).filter((origin) => origin.length > 0);
|
|
69735
|
+
}
|
|
69732
69736
|
function securityHeaders() {
|
|
69733
69737
|
return {
|
|
69734
69738
|
"Content-Security-Policy": [
|
|
@@ -69740,7 +69744,11 @@ function securityHeaders() {
|
|
|
69740
69744
|
"img-src 'self' data:",
|
|
69741
69745
|
"font-src 'self'",
|
|
69742
69746
|
"connect-src 'self'",
|
|
69743
|
-
|
|
69747
|
+
/*
|
|
69748
|
+
* `'none'` unless somebody named an origin. A list here is a deliberate act by an operator
|
|
69749
|
+
* who wants this page inside another — a lab, a dashboard — and it names exactly which.
|
|
69750
|
+
*/
|
|
69751
|
+
frameAncestors.length === 0 ? "frame-ancestors 'none'" : `frame-ancestors ${frameAncestors.join(" ")}`,
|
|
69744
69752
|
"base-uri 'none'",
|
|
69745
69753
|
"form-action 'none'"
|
|
69746
69754
|
].join("; "),
|
|
@@ -70667,6 +70675,7 @@ var STREAM_PADDING = `: ${(() => {
|
|
|
70667
70675
|
async function startServer(options) {
|
|
70668
70676
|
const log = options.logSink ?? ((line) => process.stderr.write(`${line}
|
|
70669
70677
|
`));
|
|
70678
|
+
setFrameAncestors(options.allowFrameAncestors ?? []);
|
|
70670
70679
|
const identity = options.identity ?? (options.noToken === true ? new OpenIdentity() : new SingleUserIdentity(options.handoffSeconds));
|
|
70671
70680
|
const roles = options.roles ?? SINGLE_USER_POLICY;
|
|
70672
70681
|
const sharedStore = options.sharedConfig;
|
|
@@ -71171,7 +71180,7 @@ function respondJson(response, status, body) {
|
|
|
71171
71180
|
}
|
|
71172
71181
|
|
|
71173
71182
|
// src/cli.ts
|
|
71174
|
-
var VERSION = true ? "0.
|
|
71183
|
+
var VERSION = true ? "0.68.0" : "unknown (not a packaged build)";
|
|
71175
71184
|
var compat = installNodeCompat();
|
|
71176
71185
|
function lastMeaningfulLine(problem) {
|
|
71177
71186
|
const lines = problem.split(String.fromCharCode(10)).map((line) => line.trim()).filter((line) => line.length > 0 && !line.endsWith(":"));
|
|
@@ -71238,6 +71247,7 @@ Did you mean: --admin-id ${strayAdminValue.join(" --admin-id ")}
|
|
|
71238
71247
|
const noToken = args.includes("--no-token");
|
|
71239
71248
|
const printUrl = args.includes("--print-url");
|
|
71240
71249
|
const publicUrl = valueOf(args, "--public-url");
|
|
71250
|
+
const allowFrameAncestors = valuesOf(args, "--allow-frame-ancestor");
|
|
71241
71251
|
const allowHosts = valuesOf(args, "--allow-host");
|
|
71242
71252
|
const allowOrigins = valuesOf(args, "--allow-origin");
|
|
71243
71253
|
const handoffSeconds = Math.min(
|
|
@@ -71297,6 +71307,7 @@ Did you mean: --admin-id ${strayAdminValue.join(" --admin-id ")}
|
|
|
71297
71307
|
* Somebody who typed the address is telling us it is theirs, which is the same statement
|
|
71298
71308
|
* `--allow-host` makes and this saves them making it twice.
|
|
71299
71309
|
*/
|
|
71310
|
+
allowFrameAncestors,
|
|
71300
71311
|
allowHosts: [...allowHosts, ...trustedFromPublicUrl(publicUrl).hosts],
|
|
71301
71312
|
allowOrigins: [...allowOrigins, ...trustedFromPublicUrl(publicUrl).origins],
|
|
71302
71313
|
/*
|
|
@@ -71458,6 +71469,7 @@ var KNOWN_FLAGS = /* @__PURE__ */ new Set([
|
|
|
71458
71469
|
"--print-url",
|
|
71459
71470
|
"--allow-host",
|
|
71460
71471
|
"--allow-origin",
|
|
71472
|
+
"--allow-frame-ancestor",
|
|
71461
71473
|
"--server",
|
|
71462
71474
|
"--admin",
|
|
71463
71475
|
"--admin-id",
|
|
@@ -71553,6 +71565,10 @@ Usage: light-code [options]
|
|
|
71553
71565
|
Under JupyterHub give only the hub's base URL \u2014 the
|
|
71554
71566
|
/user/<you>/proxy/<port>/ part is worked out, including the
|
|
71555
71567
|
port, which you cannot know before it starts.
|
|
71568
|
+
--allow-frame-ancestor <o> An origin allowed to embed this page in a frame, e.g.
|
|
71569
|
+
https://your-jupyterhub to show it inside JupyterLab. Off by
|
|
71570
|
+
default: framing is how clickjacking reaches an approval
|
|
71571
|
+
dialog, so each origin is named rather than guessed.
|
|
71556
71572
|
--allow-host <h> An extra name to answer to, e.g. a reverse proxy or a
|
|
71557
71573
|
container alias (repeatable)
|
|
71558
71574
|
--allow-origin <o> An extra origin allowed to call it, e.g. an app embedding
|
package/dist/server.js
CHANGED
|
@@ -69169,6 +69169,10 @@ function checkRequest(request, policy, options) {
|
|
|
69169
69169
|
}
|
|
69170
69170
|
return void 0;
|
|
69171
69171
|
}
|
|
69172
|
+
var frameAncestors = [];
|
|
69173
|
+
function setFrameAncestors(origins) {
|
|
69174
|
+
frameAncestors = origins.map((origin) => origin.trim()).filter((origin) => origin.length > 0);
|
|
69175
|
+
}
|
|
69172
69176
|
function securityHeaders() {
|
|
69173
69177
|
return {
|
|
69174
69178
|
"Content-Security-Policy": [
|
|
@@ -69180,7 +69184,11 @@ function securityHeaders() {
|
|
|
69180
69184
|
"img-src 'self' data:",
|
|
69181
69185
|
"font-src 'self'",
|
|
69182
69186
|
"connect-src 'self'",
|
|
69183
|
-
|
|
69187
|
+
/*
|
|
69188
|
+
* `'none'` unless somebody named an origin. A list here is a deliberate act by an operator
|
|
69189
|
+
* who wants this page inside another — a lab, a dashboard — and it names exactly which.
|
|
69190
|
+
*/
|
|
69191
|
+
frameAncestors.length === 0 ? "frame-ancestors 'none'" : `frame-ancestors ${frameAncestors.join(" ")}`,
|
|
69184
69192
|
"base-uri 'none'",
|
|
69185
69193
|
"form-action 'none'"
|
|
69186
69194
|
].join("; "),
|
|
@@ -70107,6 +70115,7 @@ var STREAM_PADDING = `: ${(() => {
|
|
|
70107
70115
|
async function startServer(options) {
|
|
70108
70116
|
const log = options.logSink ?? ((line) => process.stderr.write(`${line}
|
|
70109
70117
|
`));
|
|
70118
|
+
setFrameAncestors(options.allowFrameAncestors ?? []);
|
|
70110
70119
|
const identity = options.identity ?? (options.noToken === true ? new OpenIdentity() : new SingleUserIdentity(options.handoffSeconds));
|
|
70111
70120
|
const roles = options.roles ?? SINGLE_USER_POLICY;
|
|
70112
70121
|
const sharedStore = options.sharedConfig;
|
package/package.json
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@chosengeneration/light-code",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A minimal agentic coding assistant, served to your browser from a local Node server",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"bin": {
|
|
8
|
-
"light-code": "dist/cli.js"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist/**/*.js",
|
|
12
|
-
"dist/**/*.html",
|
|
13
|
-
"dist/**/*.css",
|
|
14
|
-
"dist/**/*.svg",
|
|
15
|
-
"README.md",
|
|
16
|
-
"LICENSE"
|
|
17
|
-
],
|
|
18
|
-
"scripts": {
|
|
19
|
-
"build": "node ../../scripts/generate-operator-guide.mjs && node esbuild.mjs",
|
|
20
|
-
"typecheck": "tsc -b tsconfig.json",
|
|
21
|
-
"start": "node ./dist/cli.js",
|
|
22
|
-
"generate:guide": "node ../../scripts/generate-operator-guide.mjs"
|
|
23
|
-
},
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"@light-code/core": "workspace:*",
|
|
26
|
-
"@light-code/ui": "workspace:*",
|
|
27
|
-
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
28
|
-
"@types/react": "^19.2.18",
|
|
29
|
-
"@types/react-dom": "^19.2.4",
|
|
30
|
-
"env-paths": "^3.0.0",
|
|
31
|
-
"esbuild": "^0.27.2",
|
|
32
|
-
"react": "^19.2.8",
|
|
33
|
-
"react-dom": "^19.2.8",
|
|
34
|
-
"undici": "^5.29.0",
|
|
35
|
-
"zod": "^4.4.3"
|
|
36
|
-
},
|
|
37
|
-
"keywords": [
|
|
38
|
-
"ai",
|
|
39
|
-
"agent",
|
|
40
|
-
"coding-assistant",
|
|
41
|
-
"llm",
|
|
42
|
-
"mcp",
|
|
43
|
-
"openai",
|
|
44
|
-
"anthropic",
|
|
45
|
-
"cli"
|
|
46
|
-
],
|
|
47
|
-
"homepage": "https://github.com/chosengenerationdev/light-code#readme",
|
|
48
|
-
"repository": {
|
|
49
|
-
"type": "git",
|
|
50
|
-
"url": "git+https://github.com/chosengenerationdev/light-code.git",
|
|
51
|
-
"directory": "apps/host"
|
|
52
|
-
},
|
|
53
|
-
"bugs": {
|
|
54
|
-
"url": "https://github.com/chosengenerationdev/light-code/issues"
|
|
55
|
-
},
|
|
56
|
-
"engines": {
|
|
57
|
-
"node": ">=17.0.0"
|
|
58
|
-
},
|
|
59
|
-
"publishConfig": {
|
|
60
|
-
"access": "public"
|
|
61
|
-
},
|
|
62
|
-
"optionalDependencies": {
|
|
63
|
-
"@vscode/ripgrep": "^1.18.0"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@chosengeneration/light-code",
|
|
3
|
+
"version": "0.68.0",
|
|
4
|
+
"description": "A minimal agentic coding assistant, served to your browser from a local Node server",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"light-code": "dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/**/*.js",
|
|
12
|
+
"dist/**/*.html",
|
|
13
|
+
"dist/**/*.css",
|
|
14
|
+
"dist/**/*.svg",
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "node ../../scripts/generate-operator-guide.mjs && node esbuild.mjs",
|
|
20
|
+
"typecheck": "tsc -b tsconfig.json",
|
|
21
|
+
"start": "node ./dist/cli.js",
|
|
22
|
+
"generate:guide": "node ../../scripts/generate-operator-guide.mjs"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@light-code/core": "workspace:*",
|
|
26
|
+
"@light-code/ui": "workspace:*",
|
|
27
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
28
|
+
"@types/react": "^19.2.18",
|
|
29
|
+
"@types/react-dom": "^19.2.4",
|
|
30
|
+
"env-paths": "^3.0.0",
|
|
31
|
+
"esbuild": "^0.27.2",
|
|
32
|
+
"react": "^19.2.8",
|
|
33
|
+
"react-dom": "^19.2.8",
|
|
34
|
+
"undici": "^5.29.0",
|
|
35
|
+
"zod": "^4.4.3"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"ai",
|
|
39
|
+
"agent",
|
|
40
|
+
"coding-assistant",
|
|
41
|
+
"llm",
|
|
42
|
+
"mcp",
|
|
43
|
+
"openai",
|
|
44
|
+
"anthropic",
|
|
45
|
+
"cli"
|
|
46
|
+
],
|
|
47
|
+
"homepage": "https://github.com/chosengenerationdev/light-code#readme",
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/chosengenerationdev/light-code.git",
|
|
51
|
+
"directory": "apps/host"
|
|
52
|
+
},
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/chosengenerationdev/light-code/issues"
|
|
55
|
+
},
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=17.0.0"
|
|
58
|
+
},
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
},
|
|
62
|
+
"optionalDependencies": {
|
|
63
|
+
"@vscode/ripgrep": "^1.18.0"
|
|
64
|
+
}
|
|
65
|
+
}
|