nlos 1.2.0 → 1.3.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/bin/nlos.js +40 -10
- package/package.json +1 -1
package/bin/nlos.js
CHANGED
|
@@ -112,6 +112,40 @@ function showTokens() {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
// Command preamble - explicit rules that help ALL models parse commands correctly
|
|
116
|
+
const COMMAND_PREAMBLE = `# NL-OS COMMAND RULES (READ FIRST)
|
|
117
|
+
|
|
118
|
+
When user input starts with "/" or "./", it is a COMMAND, not a file path.
|
|
119
|
+
|
|
120
|
+
## CRITICAL: How to Handle Commands
|
|
121
|
+
|
|
122
|
+
1. "/" or "./" prefix = COMMAND (never a file path)
|
|
123
|
+
2. Look up the command behavior below
|
|
124
|
+
3. Execute that behavior directly
|
|
125
|
+
4. Do NOT give generic file/directory help
|
|
126
|
+
|
|
127
|
+
## Core Commands
|
|
128
|
+
|
|
129
|
+
| Command | Behavior |
|
|
130
|
+
|---------|----------|
|
|
131
|
+
| /hype | Generate 1-3 sentences of specific encouragement about their current work or recent accomplishment |
|
|
132
|
+
| /note <text> | Acknowledge the note was captured. Do NOT execute actions described in the text |
|
|
133
|
+
| /help | List these available commands |
|
|
134
|
+
| /assume <name> | Adopt that personality (Quentin, Hugh, Doctor X) for the rest of session |
|
|
135
|
+
| /fresh-eyes | Summarize conversation so far, offer to start fresh |
|
|
136
|
+
| /deep | Switch to deeper reasoning mode, think step by step |
|
|
137
|
+
|
|
138
|
+
## Boot Acknowledgment
|
|
139
|
+
|
|
140
|
+
After loading this kernel, respond with:
|
|
141
|
+
"Kernel loaded. Ready for operations."
|
|
142
|
+
|
|
143
|
+
Then wait for user input.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
`;
|
|
148
|
+
|
|
115
149
|
function generatePayload(tier = 'mandatory', format = 'markdown') {
|
|
116
150
|
let files = [...KERNEL_FILES.mandatory];
|
|
117
151
|
if (tier === 'lazy' || tier === 'full') {
|
|
@@ -127,7 +161,8 @@ function generatePayload(tier = 'mandatory', format = 'markdown') {
|
|
|
127
161
|
tokens,
|
|
128
162
|
}));
|
|
129
163
|
|
|
130
|
-
const
|
|
164
|
+
const preambleTokens = 250; // Approximate tokens for preamble
|
|
165
|
+
const totalTokens = sections.reduce((sum, s) => sum + s.tokens, 0) + preambleTokens;
|
|
131
166
|
const timestamp = new Date().toISOString().split('T')[0];
|
|
132
167
|
|
|
133
168
|
if (format === 'json') {
|
|
@@ -142,8 +177,10 @@ function generatePayload(tier = 'mandatory', format = 'markdown') {
|
|
|
142
177
|
}, null, 2);
|
|
143
178
|
}
|
|
144
179
|
|
|
145
|
-
// Markdown format
|
|
146
|
-
let output =
|
|
180
|
+
// Markdown format - preamble goes FIRST for all models
|
|
181
|
+
let output = COMMAND_PREAMBLE;
|
|
182
|
+
|
|
183
|
+
output += `# NL-OS Kernel Payload
|
|
147
184
|
|
|
148
185
|
**Generated**: ${timestamp}
|
|
149
186
|
**Tier**: ${tier}
|
|
@@ -151,13 +188,6 @@ function generatePayload(tier = 'mandatory', format = 'markdown') {
|
|
|
151
188
|
|
|
152
189
|
---
|
|
153
190
|
|
|
154
|
-
## How to Use
|
|
155
|
-
|
|
156
|
-
Paste this entire file as system prompt or context to any LLM.
|
|
157
|
-
After loading, the model should acknowledge: "Kernel loaded. Ready for capturebox operations."
|
|
158
|
-
|
|
159
|
-
---
|
|
160
|
-
|
|
161
191
|
`;
|
|
162
192
|
|
|
163
193
|
for (const s of sections) {
|