@chosengeneration/light-code 0.37.0 → 0.44.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/README.md +113 -5
- package/dist/cli.js +3480 -1677
- package/dist/client/client.js +64 -64
- package/dist/server.js +2559 -956
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,112 @@ npx @chosengeneration/light-code --port 7100 --no-open
|
|
|
17
17
|
npx @chosengeneration/light-code --help
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
## Setting it up
|
|
21
|
+
|
|
22
|
+
For a laptop, the command above is the whole setup: open the browser, add a provider in
|
|
23
|
+
**Settings → Providers**, start typing. The rest of this section is for a server, in the
|
|
24
|
+
order the pieces actually depend on each other.
|
|
25
|
+
|
|
26
|
+
### 1. Check the banner
|
|
27
|
+
|
|
28
|
+
Everything the server worked out about its environment is printed when it starts, and it is
|
|
29
|
+
worth reading once — it is the cheapest diagnosis you will get.
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
Light Code 0.44.0
|
|
33
|
+
workspace /srv/work
|
|
34
|
+
data /home/svc/.local/share/light-code
|
|
35
|
+
listening http://127.0.0.1:7100
|
|
36
|
+
proxy HTTPS_PROXY=http://proxy.corp:3128, NO_PROXY=.corp.internal
|
|
37
|
+
user identity from whoami.py — emp0042
|
|
38
|
+
secrets creds.py — values stored as tool:<name> are fetched from it
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### 2. If your egress goes through a proxy
|
|
42
|
+
|
|
43
|
+
Nothing to configure: `HTTPS_PROXY`, `HTTP_PROXY`, `ALL_PROXY` and `NO_PROXY` are honoured,
|
|
44
|
+
with curl's rules for `NO_PROXY` and loopback never proxied. The banner shows the route.
|
|
45
|
+
|
|
46
|
+
This matters more than it sounds. Node's HTTP stack does *not* read these variables by
|
|
47
|
+
default, so a server whose every other program reaches the gateway can have Light Code alone
|
|
48
|
+
sit there — a proxied network drops a direct connection rather than refusing it, and a
|
|
49
|
+
dropped connection waits for the operating system, which takes minutes. If you have ever
|
|
50
|
+
seen a spinner that never resolves while `curl` works fine, that was this.
|
|
51
|
+
|
|
52
|
+
### 3. Tell it who the user is (optional)
|
|
53
|
+
|
|
54
|
+
By default a local server has one user and files everything under one directory. If your
|
|
55
|
+
environment has a library that knows who is logged in, write a function:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
# whoami.py
|
|
59
|
+
def run():
|
|
60
|
+
return "emp0042"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
light-code --identity-tool whoami.py --identity-python python3
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Settings, secrets and task history are then filed under whatever it returns. It runs once at
|
|
68
|
+
startup, before any session, and if it fails the server still starts and the banner says
|
|
69
|
+
why — these functions reach libraries that are not always up, and a server that will not
|
|
70
|
+
come back is worse than one that comes back explaining itself.
|
|
71
|
+
|
|
72
|
+
It must return a non-empty string. `None` is refused rather than turned into a user called
|
|
73
|
+
`None`, and anything a library prints on import is ignored rather than mistaken for the
|
|
74
|
+
answer.
|
|
75
|
+
|
|
76
|
+
### 4. Tell it where credentials come from (optional)
|
|
77
|
+
|
|
78
|
+
Same shape, taking a name:
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
# creds.py
|
|
82
|
+
def run(name):
|
|
83
|
+
entry = corporate_vault.lookup(name)
|
|
84
|
+
return {"username": entry.user, "password": entry.secret}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
light-code --credential-tool creds.py
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Now, anywhere Light Code asks for a secret, store the string `tool:<name>` instead of the
|
|
92
|
+
secret itself:
|
|
93
|
+
|
|
94
|
+
| You type | It fetches |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| `tool:gateway` | the whole value, or `password`/`secret`/`token`/`value`/`key` from a dict |
|
|
97
|
+
| `tool:opensearch#username` | that field exactly |
|
|
98
|
+
| `tool:opensearch#password` | that field exactly |
|
|
99
|
+
|
|
100
|
+
The secrets file then holds only the *names* of things to go and ask for. Values are fetched
|
|
101
|
+
when they are used and cached for a few seconds, so rotating one in your vault reaches the
|
|
102
|
+
next request without anything here being cleared.
|
|
103
|
+
|
|
104
|
+
**The assistant cannot call this function.** It is a source of secrets, reached only by the
|
|
105
|
+
code that was already allowed to resolve one — a tool the model could call would put your
|
|
106
|
+
password in the transcript.
|
|
107
|
+
|
|
108
|
+
### 5. Add a provider
|
|
109
|
+
|
|
110
|
+
**Settings → Providers.** Any OpenAI-compatible, Anthropic or Gemini endpoint. Several named
|
|
111
|
+
profiles, switchable from the composer. Mutual-TLS and client-credentials auth for corporate
|
|
112
|
+
gateways, and a **Test Connection** button that reports *which* step failed — certificates,
|
|
113
|
+
token, or listing models.
|
|
114
|
+
|
|
115
|
+
If you configured a credential function, put `tool:<name>` in the API key field.
|
|
116
|
+
|
|
117
|
+
### 6. Optional extras
|
|
118
|
+
|
|
119
|
+
- **Expert** — set one of your profiles as a second opinion the assistant can consult on hard
|
|
120
|
+
problems. Any model you have configured; there is nothing to install.
|
|
121
|
+
- **Search** — an OpenSearch, Qdrant or Chroma connection for indexing a codebase or
|
|
122
|
+
documentation.
|
|
123
|
+
- **Python tools** — off by default. Read §13 of the project's CLAUDE.md before enabling it:
|
|
124
|
+
it makes the *body* of a tool model-authored.
|
|
125
|
+
|
|
20
126
|
## What it does
|
|
21
127
|
|
|
22
128
|
A chat UI with a small set of agent tools and nothing else:
|
|
@@ -26,10 +132,7 @@ A chat UI with a small set of agent tools and nothing else:
|
|
|
26
132
|
is written
|
|
27
133
|
- **Run commands** — in a real shell, one approval at a time
|
|
28
134
|
- **MCP tools** — stdio and Streamable HTTP servers, each tool individually toggleable
|
|
29
|
-
- **Ask a stronger model** — optional; consults
|
|
30
|
-
|
|
31
|
-
Any OpenAI-compatible, Anthropic, or Gemini endpoint. Several named profiles, switchable
|
|
32
|
-
from the composer. Mutual-TLS and client-credentials auth for corporate gateways.
|
|
135
|
+
- **Ask a stronger model** — optional; consults a provider profile you have configured
|
|
33
136
|
|
|
34
137
|
## What it does not do
|
|
35
138
|
|
|
@@ -42,6 +145,10 @@ agent executes on your instruction run with your privileges, exactly as if you h
|
|
|
42
145
|
them. The approval gate is what stands between the model and your machine; there is no
|
|
43
146
|
second layer behind it.
|
|
44
147
|
|
|
148
|
+
The Excel and Outlook integration, and the indexed-mail search, are in the **VS Code
|
|
149
|
+
extension only**. They attach to applications running on somebody's desktop, which a server
|
|
150
|
+
has no route to.
|
|
151
|
+
|
|
45
152
|
## Security
|
|
46
153
|
|
|
47
154
|
Loopback is not a security boundary — any page you have open can send requests to
|
|
@@ -57,7 +164,8 @@ Loopback is not a security boundary — any page you have open can send requests
|
|
|
57
164
|
Config, secrets and history live under your OS application-data directory, per user.
|
|
58
165
|
**Secrets are stored in an owner-only file, not an OS keychain** — the extension gets
|
|
59
166
|
DPAPI/Keychain through VS Code, the server has no equivalent without a native module, and
|
|
60
|
-
the UI says which backend is active rather than implying the stronger one.
|
|
167
|
+
the UI says which backend is active rather than implying the stronger one. A credential
|
|
168
|
+
function (step 4) avoids the question entirely, since nothing is stored.
|
|
61
169
|
|
|
62
170
|
## Hosting it for a team
|
|
63
171
|
|