@pellux/goodvibes-agent 0.1.12 → 0.1.13
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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/tools/wrfc-agent-guard.ts +26 -0
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pellux/goodvibes-agent",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Near-fork GoodVibes operator assistant with the GoodVibes TUI shell, renderer, input, fullscreen workspace, and daemon-connected Agent product brain.",
|
|
6
6
|
"type": "module",
|
|
@@ -10,6 +10,8 @@ type AgentToolPolicyGuardOptions = {
|
|
|
10
10
|
readonly getLastUserMessage?: () => string | null;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
const BLOCKED_MAIN_CONVERSATION_TOOL_NAMES = ['write', 'edit', 'workflow', 'repl'] as const;
|
|
14
|
+
|
|
13
15
|
const READ_ONLY_AGENT_TOOL_MODES = [
|
|
14
16
|
'status',
|
|
15
17
|
'list',
|
|
@@ -23,6 +25,7 @@ const READ_ONLY_AGENT_TOOL_MODES = [
|
|
|
23
25
|
] as const;
|
|
24
26
|
|
|
25
27
|
const READ_ONLY_AGENT_TOOL_MODE_SET = new Set<string>(READ_ONLY_AGENT_TOOL_MODES);
|
|
28
|
+
const BLOCKED_MAIN_CONVERSATION_TOOL_NAME_SET = new Set<string>(BLOCKED_MAIN_CONVERSATION_TOOL_NAMES);
|
|
26
29
|
|
|
27
30
|
const LOCAL_AGENT_DENIAL = [
|
|
28
31
|
'GoodVibes Agent does not spawn local Engineer/Reviewer/Tester/Verifier roots or run local WRFC chains.',
|
|
@@ -30,10 +33,21 @@ const LOCAL_AGENT_DENIAL = [
|
|
|
30
33
|
'For explicit build/fix/review work, delegate one request to GoodVibes TUI through the public shared-session/build-delegation contract with the full original user ask.',
|
|
31
34
|
].join(' ');
|
|
32
35
|
|
|
36
|
+
const LOCAL_CODING_TOOL_DENIAL = [
|
|
37
|
+
'GoodVibes Agent does not perform direct local file mutation, local WRFC workflow execution, or local sandbox/REPL execution from the main conversation.',
|
|
38
|
+
'For explicit build/fix/review/code execution work, delegate one request to GoodVibes TUI through the public shared-session/build-delegation contract with the full original user ask.',
|
|
39
|
+
'For durable Agent memory, skills, personas, routines, and knowledge, use the Agent-owned commands and isolated Agent Knowledge routes.',
|
|
40
|
+
].join(' ');
|
|
41
|
+
|
|
33
42
|
export function installAgentToolPolicyGuard(registry: ToolRegistry, options: AgentToolPolicyGuardOptions = {}): void {
|
|
34
43
|
const agentTool = registry.list().find((tool) => tool.definition.name === 'agent');
|
|
35
44
|
if (!agentTool) throw new Error('Agent tool policy guard could not find the agent tool.');
|
|
36
45
|
wrapAgentToolForAgentPolicy(agentTool, options);
|
|
46
|
+
for (const tool of registry.list()) {
|
|
47
|
+
if (BLOCKED_MAIN_CONVERSATION_TOOL_NAME_SET.has(tool.definition.name)) {
|
|
48
|
+
wrapBlockedMainConversationToolForAgentPolicy(tool);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
37
51
|
}
|
|
38
52
|
|
|
39
53
|
export function wrapAgentToolForAgentPolicy(tool: Tool, _options: AgentToolPolicyGuardOptions = {}): void {
|
|
@@ -55,8 +69,20 @@ export function normalizeAgentToolInvocationForAgentPolicy(args: AgentToolArgs):
|
|
|
55
69
|
return args;
|
|
56
70
|
}
|
|
57
71
|
|
|
72
|
+
export function wrapBlockedMainConversationToolForAgentPolicy(tool: Tool): void {
|
|
73
|
+
tool.definition.description = [
|
|
74
|
+
`Blocked in GoodVibes Agent main conversation: ${tool.definition.name}.`,
|
|
75
|
+
'Use explicit GoodVibes TUI build delegation for build/fix/review/code execution work.',
|
|
76
|
+
'Use Agent-owned local registries and isolated Agent Knowledge routes for Agent memory and knowledge work.',
|
|
77
|
+
].join(' ');
|
|
78
|
+
tool.definition.sideEffects = [];
|
|
79
|
+
tool.execute = async () => ({ success: false, error: LOCAL_CODING_TOOL_DENIAL });
|
|
80
|
+
}
|
|
81
|
+
|
|
58
82
|
export const AGENT_LOCAL_SPAWN_DENIAL_MESSAGE = LOCAL_AGENT_DENIAL;
|
|
59
83
|
export const AGENT_READ_ONLY_TOOL_MODES = READ_ONLY_AGENT_TOOL_MODES;
|
|
84
|
+
export const AGENT_BLOCKED_MAIN_CONVERSATION_TOOL_NAMES = BLOCKED_MAIN_CONVERSATION_TOOL_NAMES;
|
|
85
|
+
export const AGENT_MAIN_CONVERSATION_TOOL_DENIAL_MESSAGE = LOCAL_CODING_TOOL_DENIAL;
|
|
60
86
|
|
|
61
87
|
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
62
88
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
package/src/version.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { join } from 'node:path';
|
|
|
6
6
|
// The prebuild script updates the fallback value before compilation.
|
|
7
7
|
// Uses import.meta.dir (Bun) to locate package.json relative to this file,
|
|
8
8
|
// which is correct regardless of the process working directory.
|
|
9
|
-
let _version = '0.1.
|
|
9
|
+
let _version = '0.1.13';
|
|
10
10
|
let _sdkVersion = '0.33.35';
|
|
11
11
|
try {
|
|
12
12
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', 'package.json'), 'utf-8')) as {
|