lazyclaw 6.9.1 → 6.9.3

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/commands/chat.mjs CHANGED
@@ -176,7 +176,8 @@ export async function cmdChat(flags = {}) {
176
176
  if (sys) _inkSysParts.push(sys);
177
177
  } catch (err) { console.error(`skill error: ${err.message}`); process.exit(2); }
178
178
  }
179
- if (_inkSysParts.length && !_inkMessages.some((m) => m.role === 'system')) {
179
+ // Always send the base guard system prompt (even on a fresh install).
180
+ if (!_inkMessages.some((m) => m.role === 'system')) {
180
181
  const merged = [..._inkSysParts, LAZYCLAW_META_GUARD].join('\n\n---\n\n');
181
182
  _inkMessages.unshift({ role: 'system', content: merged });
182
183
  if (_inkSessionId) sessionsMod.appendTurn(_inkSessionId, 'system', merged, _inkCfgDir);
@@ -456,7 +457,7 @@ export async function cmdChat(flags = {}) {
456
457
  process.exit(2);
457
458
  }
458
459
  }
459
- if (sysParts.length && !messages.some(m => m.role === 'system')) {
460
+ if (!messages.some(m => m.role === 'system')) {
460
461
  const merged = [...sysParts, LAZYCLAW_META_GUARD].join('\n\n---\n\n');
461
462
  messages.unshift({ role: 'system', content: merged });
462
463
  if (sessionId) sessionsMod.appendTurn(sessionId, 'system', merged, cfgDir);
@@ -17,12 +17,16 @@ import { orchestratorGet, orchestratorSet, orchestratorEnable } from '../config_
17
17
  // and planner/worker swaps ARE applied for real by detectConfigCommand above;
18
18
  // everything else must be redirected to a command, not faked.
19
19
  export const LAZYCLAW_META_GUARD =
20
- 'You are running inside the lazyclaw CLI. You CANNOT change lazyclaw\'s own configuration ' +
21
- '(provider, orchestrator planner/workers, models, agents, teams) from this chat you have no tool for it. ' +
22
- 'If the user asks you to change a setting, do NOT claim you did it. Instead give the exact command: ' +
23
- '`/orchestrator off | planner <provider:model> | worker add <provider:model>`, `lazyclaw agent add …`, ' +
24
- '`lazyclaw team …`, or `lazyclaw config set <key> <value>`. ' +
25
- '(Plain-language orchestrator on/off and planner/worker model changes are applied automatically others are not.)';
20
+ 'You are a user-facing assistant inside the lazyclaw CLI. Keep replies brief and conversational. ' +
21
+ 'Do NOT fabricate command execution: never print a fenced ```bash/```sh/```shell/```console block as if you ' +
22
+ 'are about to run it, never claim you ran, are running, or "will run" a command you cannot execute (no ' +
23
+ '"Running it now"), and never invent command output, exit/error codes, stack traces, or JSON. ' +
24
+ 'You CANNOT see or change lazyclaw\'s configuration here you do NOT know which providers, models, channels, ' +
25
+ 'agents, or teams exist, so NEVER invent or assume config names (e.g. a channel named "test" or "main") or ' +
26
+ 'pretend a target/value exists. If a request needs something that is not set up, or that you cannot do here, ' +
27
+ 'just say so briefly in plain language and stop; you may name the relevant feature (e.g. "the setup wizard"), ' +
28
+ 'but do NOT print raw `lazyclaw …` commands, "Run:" lines, or guessed values. ' +
29
+ '(Plain-language orchestrator on/off and planner/worker model changes ARE applied automatically — others are not.)';
26
30
 
27
31
  const ORCH = /오케스트라|오케스트레이터|오케스트레이션|orchestrat/i;
28
32
  const OFF = /\boff\b|\bdisable\b|끄|꺼|비활성/i;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lazyclaw",
3
- "version": "6.9.1",
3
+ "version": "6.9.3",
4
4
  "description": "Lazy, elegant terminal CLI for chatting with Claude / OpenAI / Gemini / Ollama, orchestrating multi-step LLM workflows, and running multi-agent Slack teams with cross-task memory. Banner-on-launch, slash-command ghost autocomplete, persistent sessions, local HTTP gateway.",
5
5
  "keywords": [
6
6
  "claude",
@@ -47,12 +47,13 @@ export const mockProvider = {
47
47
  async *sendMessage(messages, opts = {}) {
48
48
  const last = messages[messages.length - 1];
49
49
  const sys = messages.find((m) => m.role === 'system')?.content || '';
50
- // When a system message is present, prefix the echo with [sys:...]
51
- // so callers (and especially tests) can verify what the provider
52
- // saw in the system slot. No system byte-identical to the prior
53
- // shape so existing assertions stay green.
50
+ // When a system message is present, prefix the echo with [sys:…] so tests
51
+ // can verify the provider saw a system slot. Keep it SHORT (tests only check
52
+ // the prefix) the always-on guard prompt is ~1k chars and echoing it all
53
+ // made every reply huge, timing out the 5ms/char stream (phase5-memory).
54
+ // No system → byte-identical to the prior shape so existing assertions stay green.
54
55
  const reply = sys
55
- ? `[sys:${String(sys).slice(0, 8000)}]\nmock-reply: ${last?.content ?? ''}`
56
+ ? `[sys:${String(sys).slice(0, 80)}]\nmock-reply: ${last?.content ?? ''}`
56
57
  : `mock-reply: ${last?.content ?? ''}`;
57
58
  // Honor opts.signal so the chat REPL's Ctrl+C handler (and any
58
59
  // other caller) can stop the stream mid-flight. The other concrete