@chosengeneration/light-code 0.67.0 → 0.69.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 +24 -2
- package/dist/server.js +14 -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,15 @@ 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
|
+
/*
|
|
69752
|
+
* `'self'` always, plus whatever was declared. Same-origin framing is what a proxy serving
|
|
69753
|
+
* this page under somebody's own host looks like, and refusing it protected nothing.
|
|
69754
|
+
*/
|
|
69755
|
+
`frame-ancestors 'self'${frameAncestors.length === 0 ? "" : ` ${frameAncestors.join(" ")}`}`,
|
|
69744
69756
|
"base-uri 'none'",
|
|
69745
69757
|
"form-action 'none'"
|
|
69746
69758
|
].join("; "),
|
|
@@ -70667,6 +70679,7 @@ var STREAM_PADDING = `: ${(() => {
|
|
|
70667
70679
|
async function startServer(options) {
|
|
70668
70680
|
const log = options.logSink ?? ((line) => process.stderr.write(`${line}
|
|
70669
70681
|
`));
|
|
70682
|
+
setFrameAncestors(options.allowFrameAncestors ?? []);
|
|
70670
70683
|
const identity = options.identity ?? (options.noToken === true ? new OpenIdentity() : new SingleUserIdentity(options.handoffSeconds));
|
|
70671
70684
|
const roles = options.roles ?? SINGLE_USER_POLICY;
|
|
70672
70685
|
const sharedStore = options.sharedConfig;
|
|
@@ -71171,7 +71184,7 @@ function respondJson(response, status, body) {
|
|
|
71171
71184
|
}
|
|
71172
71185
|
|
|
71173
71186
|
// src/cli.ts
|
|
71174
|
-
var VERSION = true ? "0.
|
|
71187
|
+
var VERSION = true ? "0.69.0" : "unknown (not a packaged build)";
|
|
71175
71188
|
var compat = installNodeCompat();
|
|
71176
71189
|
function lastMeaningfulLine(problem) {
|
|
71177
71190
|
const lines = problem.split(String.fromCharCode(10)).map((line) => line.trim()).filter((line) => line.length > 0 && !line.endsWith(":"));
|
|
@@ -71238,6 +71251,7 @@ Did you mean: --admin-id ${strayAdminValue.join(" --admin-id ")}
|
|
|
71238
71251
|
const noToken = args.includes("--no-token");
|
|
71239
71252
|
const printUrl = args.includes("--print-url");
|
|
71240
71253
|
const publicUrl = valueOf(args, "--public-url");
|
|
71254
|
+
const allowFrameAncestors = valuesOf(args, "--allow-frame-ancestor");
|
|
71241
71255
|
const allowHosts = valuesOf(args, "--allow-host");
|
|
71242
71256
|
const allowOrigins = valuesOf(args, "--allow-origin");
|
|
71243
71257
|
const handoffSeconds = Math.min(
|
|
@@ -71297,6 +71311,7 @@ Did you mean: --admin-id ${strayAdminValue.join(" --admin-id ")}
|
|
|
71297
71311
|
* Somebody who typed the address is telling us it is theirs, which is the same statement
|
|
71298
71312
|
* `--allow-host` makes and this saves them making it twice.
|
|
71299
71313
|
*/
|
|
71314
|
+
allowFrameAncestors,
|
|
71300
71315
|
allowHosts: [...allowHosts, ...trustedFromPublicUrl(publicUrl).hosts],
|
|
71301
71316
|
allowOrigins: [...allowOrigins, ...trustedFromPublicUrl(publicUrl).origins],
|
|
71302
71317
|
/*
|
|
@@ -71458,6 +71473,7 @@ var KNOWN_FLAGS = /* @__PURE__ */ new Set([
|
|
|
71458
71473
|
"--print-url",
|
|
71459
71474
|
"--allow-host",
|
|
71460
71475
|
"--allow-origin",
|
|
71476
|
+
"--allow-frame-ancestor",
|
|
71461
71477
|
"--server",
|
|
71462
71478
|
"--admin",
|
|
71463
71479
|
"--admin-id",
|
|
@@ -71553,6 +71569,12 @@ Usage: light-code [options]
|
|
|
71553
71569
|
Under JupyterHub give only the hub's base URL \u2014 the
|
|
71554
71570
|
/user/<you>/proxy/<port>/ part is worked out, including the
|
|
71555
71571
|
port, which you cannot know before it starts.
|
|
71572
|
+
--allow-frame-ancestor <o> A FURTHER origin allowed to embed this page in a
|
|
71573
|
+
frame. The page's own origin is always allowed, so a proxy
|
|
71574
|
+
serving it under your host - JupyterLab, say - can frame it
|
|
71575
|
+
with no flag at all. Name one here only to embed it from a
|
|
71576
|
+
different origin: framing is how clickjacking reaches an
|
|
71577
|
+
approval dialog, so those are named rather than guessed.
|
|
71556
71578
|
--allow-host <h> An extra name to answer to, e.g. a reverse proxy or a
|
|
71557
71579
|
container alias (repeatable)
|
|
71558
71580
|
--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,15 @@ 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
|
+
/*
|
|
69192
|
+
* `'self'` always, plus whatever was declared. Same-origin framing is what a proxy serving
|
|
69193
|
+
* this page under somebody's own host looks like, and refusing it protected nothing.
|
|
69194
|
+
*/
|
|
69195
|
+
`frame-ancestors 'self'${frameAncestors.length === 0 ? "" : ` ${frameAncestors.join(" ")}`}`,
|
|
69184
69196
|
"base-uri 'none'",
|
|
69185
69197
|
"form-action 'none'"
|
|
69186
69198
|
].join("; "),
|
|
@@ -70107,6 +70119,7 @@ var STREAM_PADDING = `: ${(() => {
|
|
|
70107
70119
|
async function startServer(options) {
|
|
70108
70120
|
const log = options.logSink ?? ((line) => process.stderr.write(`${line}
|
|
70109
70121
|
`));
|
|
70122
|
+
setFrameAncestors(options.allowFrameAncestors ?? []);
|
|
70110
70123
|
const identity = options.identity ?? (options.noToken === true ? new OpenIdentity() : new SingleUserIdentity(options.handoffSeconds));
|
|
70111
70124
|
const roles = options.roles ?? SINGLE_USER_POLICY;
|
|
70112
70125
|
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.69.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
|
+
}
|