mirror of
https://github.com/qwibitai/nanoclaw.git
synced 2026-07-15 19:06:18 +08:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b508bb951e | |||
| 3f643201c6 | |||
| 82d9171985 | |||
| c1445876a6 | |||
| 5a114b5427 | |||
| 790a7a6dfd | |||
| f24edc2c3b | |||
| fe235c7ca0 | |||
| a9e5231039 | |||
| f87f82c528 | |||
| 35ca4e14d2 | |||
| 69e3b57d9d |
@@ -24,10 +24,6 @@ function log(msg: string): void {
|
||||
// the question and blocks on the real reply.
|
||||
// - EnterPlanMode / ExitPlanMode / EnterWorktree / ExitWorktree: Claude
|
||||
// Code UI affordances; in a headless container they'd appear stuck.
|
||||
// - DesignSync: desktop design-tool integration — nothing to sync with in a
|
||||
// headless container (~9.3KB/turn schema).
|
||||
// - ReportFindings: code-review-reporting UI affordance with no headless
|
||||
// host surface to receive it (~1.9KB/turn schema).
|
||||
const SDK_DISALLOWED_TOOLS = [
|
||||
'CronCreate',
|
||||
'CronDelete',
|
||||
@@ -38,8 +34,6 @@ const SDK_DISALLOWED_TOOLS = [
|
||||
'ExitPlanMode',
|
||||
'EnterWorktree',
|
||||
'ExitWorktree',
|
||||
'DesignSync',
|
||||
'ReportFindings',
|
||||
];
|
||||
|
||||
// Tool allowlist for NanoClaw agent containers. MCP-tool entries are derived
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nanoclaw",
|
||||
"version": "2.1.47",
|
||||
"version": "2.1.46",
|
||||
"description": "Personal Claude assistant. Lightweight, secure, customizable.",
|
||||
"type": "module",
|
||||
"packageManager": "pnpm@10.33.0",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="20" role="img" aria-label="240k tokens, 120% of context window">
|
||||
<title>240k tokens, 120% of context window</title>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="20" role="img" aria-label="232k tokens, 116% of context window">
|
||||
<title>232k tokens, 116% of context window</title>
|
||||
<linearGradient id="s" x2="0" y2="100%">
|
||||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
||||
<stop offset="1" stop-opacity=".1"/>
|
||||
@@ -15,8 +15,8 @@
|
||||
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="11">
|
||||
<text aria-hidden="true" x="26" y="15" fill="#010101" fill-opacity=".3">tokens</text>
|
||||
<text x="26" y="14">tokens</text>
|
||||
<text aria-hidden="true" x="71" y="15" fill="#010101" fill-opacity=".3">240k</text>
|
||||
<text x="71" y="14">240k</text>
|
||||
<text aria-hidden="true" x="71" y="15" fill="#010101" fill-opacity=".3">232k</text>
|
||||
<text x="71" y="14">232k</text>
|
||||
</g>
|
||||
</g>
|
||||
</a>
|
||||
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1,68 +0,0 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
const TEST_ROOT = '/tmp/nanoclaw-group-init-settings-test';
|
||||
|
||||
vi.mock('./config.js', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import('./config.js')>()),
|
||||
DATA_DIR: '/tmp/nanoclaw-group-init-settings-test/data',
|
||||
GROUPS_DIR: '/tmp/nanoclaw-group-init-settings-test/groups',
|
||||
}));
|
||||
|
||||
vi.mock('./log.js', () => ({
|
||||
log: { debug: vi.fn(), info: vi.fn(), warn: vi.fn(), error: vi.fn(), fatal: vi.fn() },
|
||||
}));
|
||||
|
||||
import { closeDb, createAgentGroup, initTestDb, runMigrations } from './db/index.js';
|
||||
import { initGroupFilesystem } from './group-init.js';
|
||||
import type { AgentGroup } from './types.js';
|
||||
|
||||
function makeGroup(id: string): AgentGroup {
|
||||
const ag = { id, name: id, folder: id, agent_provider: null, created_at: new Date().toISOString() } as AgentGroup;
|
||||
createAgentGroup(ag);
|
||||
return ag;
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
fs.rmSync(TEST_ROOT, { recursive: true, force: true });
|
||||
fs.mkdirSync(TEST_ROOT, { recursive: true });
|
||||
runMigrations(initTestDb());
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
closeDb();
|
||||
fs.rmSync(TEST_ROOT, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
describe('default settings.json for new groups', () => {
|
||||
it('is lean: no agent-teams env key, unmanaged keys intact', () => {
|
||||
const ag = makeGroup('ag-lean');
|
||||
initGroupFilesystem(ag, {});
|
||||
|
||||
const file = path.join(TEST_ROOT, 'data', 'v2-sessions', ag.id, '.claude-shared', 'settings.json');
|
||||
const settings = JSON.parse(fs.readFileSync(file, 'utf-8'));
|
||||
|
||||
expect(settings.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS).toBeUndefined();
|
||||
expect(settings.env.CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD).toBe('1');
|
||||
expect(JSON.stringify(settings.hooks.PreCompact)).toContain('compact-instructions');
|
||||
});
|
||||
|
||||
it('never rewrites an existing settings.json — a hand-edited re-enable sticks', () => {
|
||||
const ag = makeGroup('ag-reenable');
|
||||
initGroupFilesystem(ag, {});
|
||||
const file = path.join(TEST_ROOT, 'data', 'v2-sessions', ag.id, '.claude-shared', 'settings.json');
|
||||
|
||||
// Operator re-enables both features by editing the file (the documented path).
|
||||
const edited = JSON.parse(fs.readFileSync(file, 'utf-8'));
|
||||
delete edited.disableWorkflows;
|
||||
edited.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS = '1';
|
||||
fs.writeFileSync(file, JSON.stringify(edited, null, 2) + '\n');
|
||||
|
||||
initGroupFilesystem(ag, {}); // next spawn
|
||||
|
||||
const after = JSON.parse(fs.readFileSync(file, 'utf-8'));
|
||||
expect(after.disableWorkflows).toBeUndefined();
|
||||
expect(after.env.CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS).toBe('1');
|
||||
});
|
||||
});
|
||||
@@ -11,6 +11,7 @@ const DEFAULT_SETTINGS_JSON =
|
||||
JSON.stringify(
|
||||
{
|
||||
env: {
|
||||
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: '1',
|
||||
CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD: '1',
|
||||
CLAUDE_CODE_DISABLE_AUTO_MEMORY: '0',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user