laohuang 0.9.7 → 0.9.9

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 CHANGED
@@ -86,6 +86,25 @@ clipboard failures produce an explanatory message.
86
86
  tool-call/tool-result E2E was recorded; no providers are checked in as verified
87
87
  by default.
88
88
 
89
+ ## Code Mode
90
+
91
+ Use `/codemode off|on|only` for the current session and `/codemode default off|on|only`
92
+ for new sessions. Default is off. On keeps direct calls and JavaScript composition;
93
+ only disables ordinary direct calls and `tool_search`. Changes apply to the next model request.
94
+ Scripts use `await searchTools(query)`, `await tools.name({...})`, `text`, `console`,
95
+ `image`, `store`/`load`, and top-level return. Intermediate results stay private;
96
+ only explicit output and a successful return reach the model. State commits on success
97
+ or `exit()` and survives branch restore; failures do not commit state or roll back tool effects.
98
+
99
+ An optional first line `// @options: {"timeout_ms":30000,"max_output_tokens":10000}`
100
+ sets a total deadline and approximate text budget. Default deadline is unlimited.
101
+ Two shared Workers serve FIFO waiters, with a 60 second queue limit. QuickJS heap is
102
+ limited to 256 MiB, output to 16777216 UTF-16 characters or 100000 items, and store
103
+ to 262144 JSON characters per value / 1048576 including keys overall. The default
104
+ model text budget is 10000 tokens at four characters each; full selected text is
105
+ saved under `codemode-artifacts/<sessionId>` beside config when preview is truncated.
106
+ Only selected images are exposed. QuickJS isolates scripts; host tools retain user permissions.
107
+
89
108
  ## MCP
90
109
 
91
110
  MCP is built in. Put a version 1 `mcp.json` beside your model `config.json`, or
@@ -0,0 +1,23 @@
1
+ Code Mode includes parts adapted from Pi (https://github.com/earendil-works/pi).
2
+
3
+ MIT License
4
+
5
+ Copyright (c) 2025 Mario Zechner
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.