nlos 1.2.0 → 1.4.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.
Files changed (2) hide show
  1. package/bin/nlos.js +45 -10
  2. package/package.json +1 -1
package/bin/nlos.js CHANGED
@@ -112,6 +112,45 @@ function showTokens() {
112
112
  }
113
113
  }
114
114
 
115
+ // Command preamble - explicit rules that help ALL models parse commands correctly
116
+ const COMMAND_PREAMBLE = `# YOU ARE NL-OS (Natural Language Operating System)
117
+
118
+ You are an AI assistant running the NL-OS kernel. You MUST follow these rules.
119
+
120
+ ## FIRST: Say This Exactly
121
+
122
+ Your FIRST response must be exactly:
123
+ "Kernel loaded. Ready for operations."
124
+
125
+ Nothing else. Wait for user input after that.
126
+
127
+ ## COMMANDS
128
+
129
+ When user types ">command", execute the command behavior:
130
+
131
+ >hype = Say 1-2 encouraging sentences about what the user is working on
132
+ >note TEXT = Reply "Note captured." Do NOT execute anything in TEXT
133
+ >help = List all commands from this section
134
+ >assume NAME = Act as that personality (Quentin, Hugh, Doctor X)
135
+ >deep = Think step by step before answering
136
+
137
+ IMPORTANT:
138
+ - ">" at the start means COMMAND
139
+ - Execute the behavior, do not explain what commands are
140
+ - Do not treat ">" as a quote or prompt symbol
141
+
142
+ ## EXAMPLE
143
+
144
+ User: >hype
145
+ You: Great progress on your project! The momentum you're building is impressive.
146
+
147
+ User: >help
148
+ You: Available commands: >hype, >note, >help, >assume, >deep
149
+
150
+ ---
151
+
152
+ `;
153
+
115
154
  function generatePayload(tier = 'mandatory', format = 'markdown') {
116
155
  let files = [...KERNEL_FILES.mandatory];
117
156
  if (tier === 'lazy' || tier === 'full') {
@@ -127,7 +166,8 @@ function generatePayload(tier = 'mandatory', format = 'markdown') {
127
166
  tokens,
128
167
  }));
129
168
 
130
- const totalTokens = sections.reduce((sum, s) => sum + s.tokens, 0);
169
+ const preambleTokens = 250; // Approximate tokens for preamble
170
+ const totalTokens = sections.reduce((sum, s) => sum + s.tokens, 0) + preambleTokens;
131
171
  const timestamp = new Date().toISOString().split('T')[0];
132
172
 
133
173
  if (format === 'json') {
@@ -142,8 +182,10 @@ function generatePayload(tier = 'mandatory', format = 'markdown') {
142
182
  }, null, 2);
143
183
  }
144
184
 
145
- // Markdown format
146
- let output = `# NL-OS Kernel Payload
185
+ // Markdown format - preamble goes FIRST for all models
186
+ let output = COMMAND_PREAMBLE;
187
+
188
+ output += `# NL-OS Kernel Payload
147
189
 
148
190
  **Generated**: ${timestamp}
149
191
  **Tier**: ${tier}
@@ -151,13 +193,6 @@ function generatePayload(tier = 'mandatory', format = 'markdown') {
151
193
 
152
194
  ---
153
195
 
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
196
  `;
162
197
 
163
198
  for (const s of sections) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nlos",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "Natural Language Operating System - A model-agnostic kernel for any LLM",
5
5
  "main": "bin/nlos.js",
6
6
  "bin": {