pikiclaw 0.2.60 → 0.2.62
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/dist/bot.js +3 -1
- package/dist/cli.js +2 -2
- package/dist/driver-gemini.js +5 -2
- package/dist/mcp-bridge.js +6 -0
- package/dist/run.js +4 -4
- package/package.json +1 -1
package/dist/bot.js
CHANGED
|
@@ -13,6 +13,7 @@ import { getDriver, hasDriver, allDriverIds } from './agent-driver.js';
|
|
|
13
13
|
import { terminateProcessTree } from './process-control.js';
|
|
14
14
|
import { VERSION } from './version.js';
|
|
15
15
|
import { buildHumanLoopResponse, createEmptyHumanLoopAnswer, currentHumanLoopQuestion, isHumanLoopAwaitingText, setHumanLoopOption, setHumanLoopText, skipHumanLoopQuestion, } from './human-loop.js';
|
|
16
|
+
export const DEFAULT_RUN_TIMEOUT_S = 7200;
|
|
16
17
|
const MACOS_USER_ACTIVITY_PULSE_INTERVAL_MS = 20_000;
|
|
17
18
|
const MACOS_USER_ACTIVITY_PULSE_TIMEOUT_S = 30;
|
|
18
19
|
// ---------------------------------------------------------------------------
|
|
@@ -487,7 +488,7 @@ export class Bot {
|
|
|
487
488
|
},
|
|
488
489
|
};
|
|
489
490
|
this.defaultAgent = normalizeAgent('codex');
|
|
490
|
-
this.runTimeout = envInt('PIKICLAW_TIMEOUT',
|
|
491
|
+
this.runTimeout = envInt('PIKICLAW_TIMEOUT', DEFAULT_RUN_TIMEOUT_S);
|
|
491
492
|
this.allowedChatIds = parseAllowedChatIds(process.env.PIKICLAW_ALLOWED_IDS || '');
|
|
492
493
|
this.refreshManagedConfig(getActiveUserConfig(), { initial: true });
|
|
493
494
|
this.userConfigUnsubscribe = onUserConfigChange(config => this.refreshManagedConfig(config));
|
|
@@ -1096,6 +1097,7 @@ export class Bot {
|
|
|
1096
1097
|
geminiModel: cs.agent === 'gemini' ? resolvedModel : (this.agentConfigs.gemini?.model || ''),
|
|
1097
1098
|
geminiApprovalMode: this.geminiApprovalMode,
|
|
1098
1099
|
geminiSandbox: this.geminiSandbox,
|
|
1100
|
+
geminiSystemInstruction: effectiveSystemPrompt || undefined,
|
|
1099
1101
|
geminiExtraArgs: this.geminiExtraArgs.length ? this.geminiExtraArgs : undefined,
|
|
1100
1102
|
// MCP bridge
|
|
1101
1103
|
mcpSendFile,
|
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { spawn } from 'node:child_process';
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
import { startAgentAutoUpdate } from './agent-auto-update.js';
|
|
8
|
-
import { envBool } from './bot.js';
|
|
8
|
+
import { envBool, DEFAULT_RUN_TIMEOUT_S } from './bot.js';
|
|
9
9
|
import { TelegramBot } from './bot-telegram.js';
|
|
10
10
|
import { hasConfiguredChannelToken, resolveConfiguredChannels } from './cli-channels.js';
|
|
11
11
|
import { listAgents } from './code-agent.js';
|
|
@@ -256,7 +256,7 @@ Options:
|
|
|
256
256
|
--full-access Codex full-access + Claude bypassPermissions + Gemini yolo/no-sandbox [default]
|
|
257
257
|
--safe-mode Use safer agent permission modes
|
|
258
258
|
--allowed-ids <id,id> Comma-separated chat/user ID whitelist
|
|
259
|
-
--timeout <seconds> Max seconds per agent request [default:
|
|
259
|
+
--timeout <seconds> Max seconds per agent request [default: ${DEFAULT_RUN_TIMEOUT_S}]
|
|
260
260
|
--doctor Run setup checks and exit
|
|
261
261
|
--setup Run the interactive setup wizard
|
|
262
262
|
--no-daemon Disable watchdog (auto-restart on crash is ON by default)
|
package/dist/driver-gemini.js
CHANGED
|
@@ -8,7 +8,7 @@ import { registerDriver } from './agent-driver.js';
|
|
|
8
8
|
import fs from 'node:fs';
|
|
9
9
|
import path from 'node:path';
|
|
10
10
|
import { execSync } from 'node:child_process';
|
|
11
|
-
import { run, agentLog, detectAgentBin, pushRecentActivity, firstNonEmptyLine, shortValue, normalizeErrorMessage, listPikiclawSessions, mergeManagedAndNativeSessions, roundPercent, emptyUsage, Q, } from './code-agent.js';
|
|
11
|
+
import { run, agentLog, detectAgentBin, appendSystemPrompt, pushRecentActivity, firstNonEmptyLine, shortValue, normalizeErrorMessage, listPikiclawSessions, mergeManagedAndNativeSessions, roundPercent, emptyUsage, Q, } from './code-agent.js';
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
13
13
|
// Command & parser
|
|
14
14
|
// ---------------------------------------------------------------------------
|
|
@@ -39,7 +39,10 @@ function geminiCmd(o) {
|
|
|
39
39
|
if (o.geminiExtraArgs?.length)
|
|
40
40
|
args.push(...o.geminiExtraArgs);
|
|
41
41
|
// gemini's -p requires the prompt as its value (not via stdin)
|
|
42
|
-
|
|
42
|
+
const promptText = o.geminiSystemInstruction
|
|
43
|
+
? appendSystemPrompt(o.geminiSystemInstruction, o.prompt)
|
|
44
|
+
: o.prompt;
|
|
45
|
+
args.push('-p', promptText);
|
|
43
46
|
return args;
|
|
44
47
|
}
|
|
45
48
|
function geminiContextWindowFromModel(model) {
|
package/dist/mcp-bridge.js
CHANGED
|
@@ -140,6 +140,12 @@ function buildClaudeMcpConfig(servers) {
|
|
|
140
140
|
}
|
|
141
141
|
function buildGeminiMcpConfig(servers) {
|
|
142
142
|
return {
|
|
143
|
+
// Session attachments live under .pikiclaw/... and should remain readable to
|
|
144
|
+
// Gemini's built-in file tools even when the project ignores that directory.
|
|
145
|
+
fileFiltering: {
|
|
146
|
+
respectGitIgnore: false,
|
|
147
|
+
respectGeminiIgnore: false,
|
|
148
|
+
},
|
|
143
149
|
mcpServers: Object.fromEntries(servers.map(server => [
|
|
144
150
|
server.name,
|
|
145
151
|
{ command: server.command, args: server.args, ...(server.env ? { env: server.env } : {}), trust: true },
|
package/dist/run.js
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
* npm run command -- claude-models
|
|
8
8
|
* npm run command -- codex-models
|
|
9
9
|
*/
|
|
10
|
-
import { ensureGitignore, formatThinkingForDisplay } from './bot.js';
|
|
10
|
+
import { ensureGitignore, formatThinkingForDisplay, DEFAULT_RUN_TIMEOUT_S } from './bot.js';
|
|
11
11
|
import { initializeProjectSkills, listAgents, listModels, listSkills, getUsage, doStream, getSessions, getSessionTail } from './code-agent.js';
|
|
12
12
|
import { getDriver } from './agent-driver.js';
|
|
13
13
|
import { loadUserConfig, resolveUserWorkdir } from './user-config.js';
|
|
14
14
|
function parseArgs(argv) {
|
|
15
15
|
const args = {
|
|
16
|
-
command: null, model: null, workdir: null, prompt: null, timeout:
|
|
16
|
+
command: null, model: null, workdir: null, prompt: null, timeout: DEFAULT_RUN_TIMEOUT_S, help: false,
|
|
17
17
|
session: null, n: 4,
|
|
18
18
|
};
|
|
19
19
|
const positional = [];
|
|
@@ -40,7 +40,7 @@ function parseArgs(argv) {
|
|
|
40
40
|
args.n = parseInt(it.next().value ?? '', 10) || 4;
|
|
41
41
|
break;
|
|
42
42
|
case '--timeout':
|
|
43
|
-
args.timeout = parseInt(it.next().value ?? '', 10) ||
|
|
43
|
+
args.timeout = parseInt(it.next().value ?? '', 10) || DEFAULT_RUN_TIMEOUT_S;
|
|
44
44
|
break;
|
|
45
45
|
case '-h':
|
|
46
46
|
case '--help':
|
|
@@ -88,7 +88,7 @@ Options:
|
|
|
88
88
|
-w, --workdir <dir> Working directory [default: current process cwd]
|
|
89
89
|
-s, --session <id> Session ID (for tail; omit to use latest session)
|
|
90
90
|
-n <count> Number of messages to show [default: 4]
|
|
91
|
-
--timeout <seconds> Max seconds per request [default:
|
|
91
|
+
--timeout <seconds> Max seconds per request [default: ${DEFAULT_RUN_TIMEOUT_S}]
|
|
92
92
|
-h, --help Print this help
|
|
93
93
|
|
|
94
94
|
Examples:
|
package/package.json
CHANGED