@orchbee/cli-win32-x64 0.0.0-stage → 0.1.0-beta.2
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/LICENSE +21 -0
- package/README.md +4 -2
- package/package.json +22 -5
- package/release/agent-observation-adapters/.agents/plugins/marketplace.json +12 -0
- package/release/agent-observation-adapters/.claude-plugin/marketplace.json +13 -0
- package/release/agent-observation-adapters/README.md +363 -0
- package/release/agent-observation-adapters/bundle/.claude-plugin/plugin.json +8 -0
- package/release/agent-observation-adapters/bundle/.codex-plugin/plugin.json +7 -0
- package/release/agent-observation-adapters/bundle/.grok-plugin/plugin.json +7 -0
- package/release/agent-observation-adapters/bundle/.plugin/plugin.json +7 -0
- package/release/agent-observation-adapters/bundle/cline/orchbee-agent-observation.js +187 -0
- package/release/agent-observation-adapters/bundle/gemini/gemini-extension.json +5 -0
- package/release/agent-observation-adapters/bundle/gemini/hooks/hooks.json +118 -0
- package/release/agent-observation-adapters/bundle/hermes/plugin.py +40 -0
- package/release/agent-observation-adapters/bundle/hooks/codex.json +142 -0
- package/release/agent-observation-adapters/bundle/hooks/copilot.json +114 -0
- package/release/agent-observation-adapters/bundle/hooks/grok.json +170 -0
- package/release/agent-observation-adapters/bundle/hooks/hooks.json +244 -0
- package/release/agent-observation-adapters/bundle/kilo/orchbee-agent-observation.mjs +3 -0
- package/release/agent-observation-adapters/bundle/omp/orchbee-agent-observation.cjs +4 -0
- package/release/agent-observation-adapters/bundle/omp/orchbee-agent-observation.mjs +117 -0
- package/release/agent-observation-adapters/bundle/opencode/orchbee-agent-observation.mjs +13 -0
- package/release/agent-observation-adapters/bundle/package.json +25 -0
- package/release/agent-observation-adapters/bundle/pi/orchbee-agent-observation.cjs +4 -0
- package/release/agent-observation-adapters/bundle/pi/orchbee-agent-observation.mjs +112 -0
- package/release/agent-observation-adapters/bundle/qwen-code/qwen-extension.json +232 -0
- package/release/agent-observation-adapters/bundle/scripts/forward-hook.mjs +33 -0
- package/release/agent-observation-adapters/bundle/scripts/hook-sanitizers.mjs +571 -0
- package/release/agent-observation-adapters/bundle/scripts/observation-transport.mjs +549 -0
- package/release/agent-observation-adapters/bundle/scripts/opencode-family-observation.mjs +350 -0
- package/release/agent-observation-adapters/capsule.json +4 -0
- package/release/cohort.json +1 -0
- package/release/conpty/Microsoft.ConPTY-LICENSE.txt +21 -0
- package/release/conpty/OpenConsole.exe +0 -0
- package/release/conpty/conpty.dll +0 -0
- package/release/licenses/agent-detection/LICENSE +201 -0
- package/release/licenses/agent-detection/NOTICE +20 -0
- package/release/orchbee-launcher.exe +0 -0
- package/release/orchbee-server.exe +0 -0
- package/release/orchbee-terminal-host.exe +0 -0
- package/release/orchbee-worker.exe +0 -0
- package/release/orchbee.exe +4 -0
- package/release/release.json +1 -0
- package/release/release.json.sig +1 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { forwardSanitizedObservation } from '../scripts/observation-transport.mjs';
|
|
2
|
+
|
|
3
|
+
export function orchbeeAgentObservation(pi) {
|
|
4
|
+
registerPiAgentObservation(pi, orderedDelivery('pi'));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function registerPiAgentObservation(pi, deliver) {
|
|
8
|
+
const activeTurns = new Map();
|
|
9
|
+
const prompts = new Map();
|
|
10
|
+
let identitySequence = 0;
|
|
11
|
+
|
|
12
|
+
const nextKey = (prefix) => `${prefix}:${++identitySequence}`;
|
|
13
|
+
const send = (context, event, fields = {}) => {
|
|
14
|
+
const sessionKey = context.sessionManager.getSessionId();
|
|
15
|
+
if (!identity(sessionKey)) return;
|
|
16
|
+
deliver(observation(sessionKey, event, fields));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
pi.on('session_start', (_event, context) => send(context, 'session-started'));
|
|
20
|
+
pi.on('agent_start', (_event, context) => {
|
|
21
|
+
const sessionKey = context.sessionManager.getSessionId();
|
|
22
|
+
const turnKey = nextKey('turn');
|
|
23
|
+
activeTurns.set(sessionKey, turnKey);
|
|
24
|
+
send(context, 'turn-started', { activity: 'thinking', turnKey });
|
|
25
|
+
});
|
|
26
|
+
pi.on('agent_settled', (_event, context) => {
|
|
27
|
+
const sessionKey = context.sessionManager.getSessionId();
|
|
28
|
+
send(context, 'session-idle', { turnKey: activeTurns.get(sessionKey) ?? null });
|
|
29
|
+
activeTurns.delete(sessionKey);
|
|
30
|
+
prompts.delete(sessionKey);
|
|
31
|
+
});
|
|
32
|
+
pi.on('ui_prompt_start', (_event, context) => {
|
|
33
|
+
const sessionKey = context.sessionManager.getSessionId();
|
|
34
|
+
const operationKey = nextKey('prompt');
|
|
35
|
+
prompts.set(sessionKey, operationKey);
|
|
36
|
+
send(context, 'question-requested', {
|
|
37
|
+
operationKey,
|
|
38
|
+
turnKey: activeTurns.get(sessionKey) ?? null,
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
pi.on('ui_prompt_end', (_event, context) => {
|
|
42
|
+
const sessionKey = context.sessionManager.getSessionId();
|
|
43
|
+
const operationKey = prompts.get(sessionKey) ?? null;
|
|
44
|
+
prompts.delete(sessionKey);
|
|
45
|
+
send(context, 'attention-resolved', {
|
|
46
|
+
operationKey,
|
|
47
|
+
turnKey: activeTurns.get(sessionKey) ?? null,
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
pi.on('tool_execution_start', (event, context) => {
|
|
51
|
+
const sessionKey = context.sessionManager.getSessionId();
|
|
52
|
+
send(context, 'tool-started', {
|
|
53
|
+
activity: piToolActivity(event.toolName),
|
|
54
|
+
operationKey: event.toolCallId,
|
|
55
|
+
turnKey: activeTurns.get(sessionKey) ?? null,
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
pi.on('tool_execution_end', (event, context) => {
|
|
59
|
+
const sessionKey = context.sessionManager.getSessionId();
|
|
60
|
+
send(context, event.isError ? 'tool-failed' : 'tool-finished', {
|
|
61
|
+
operationKey: event.toolCallId,
|
|
62
|
+
turnKey: activeTurns.get(sessionKey) ?? null,
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
pi.on('session_before_compact', (_event, context) => {
|
|
66
|
+
const sessionKey = context.sessionManager.getSessionId();
|
|
67
|
+
send(context, 'compaction-started', { turnKey: activeTurns.get(sessionKey) ?? null });
|
|
68
|
+
});
|
|
69
|
+
pi.on('session_compact', (_event, context) => {
|
|
70
|
+
const sessionKey = context.sessionManager.getSessionId();
|
|
71
|
+
send(context, 'compaction-finished', { turnKey: activeTurns.get(sessionKey) ?? null });
|
|
72
|
+
});
|
|
73
|
+
pi.on('session_compact_failed', (_event, context) => {
|
|
74
|
+
const sessionKey = context.sessionManager.getSessionId();
|
|
75
|
+
send(context, 'compaction-finished', { turnKey: activeTurns.get(sessionKey) ?? null });
|
|
76
|
+
});
|
|
77
|
+
pi.on('session_shutdown', (_event, context) => {
|
|
78
|
+
const sessionKey = context.sessionManager.getSessionId();
|
|
79
|
+
send(context, 'session-ended', { turnKey: activeTurns.get(sessionKey) ?? null });
|
|
80
|
+
activeTurns.delete(sessionKey);
|
|
81
|
+
prompts.delete(sessionKey);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function piToolActivity(toolName) {
|
|
86
|
+
if (toolName === 'bash' || toolName === 'powershell') return 'command';
|
|
87
|
+
if (toolName === 'edit' || toolName === 'write') return 'editing';
|
|
88
|
+
return 'tool';
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function observation(sessionKey, event, fields = {}) {
|
|
92
|
+
return {
|
|
93
|
+
activity: fields.activity ?? null,
|
|
94
|
+
agentKey: null,
|
|
95
|
+
event,
|
|
96
|
+
operationKey: fields.operationKey ?? null,
|
|
97
|
+
sessionKey,
|
|
98
|
+
turnKey: fields.turnKey ?? null,
|
|
99
|
+
version: 1,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function orderedDelivery(adapterId) {
|
|
104
|
+
let pending = Promise.resolve();
|
|
105
|
+
return (value) => {
|
|
106
|
+
pending = pending.then(() => forwardSanitizedObservation(adapterId, value));
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function identity(value) {
|
|
111
|
+
return typeof value === 'string' && /^[A-Za-z0-9._:-]{1,128}$/u.test(value);
|
|
112
|
+
}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": {
|
|
3
|
+
"en": "Locally sanitizes Qwen Code lifecycle hooks for Orchbee Agent status observation",
|
|
4
|
+
"zh": "在本地清理 Qwen Code 生命周期 Hook,用于 Orchbee Agent 状态观测"
|
|
5
|
+
},
|
|
6
|
+
"displayName": {
|
|
7
|
+
"en": "Orchbee Agent Observation",
|
|
8
|
+
"zh": "Orchbee Agent 状态观测"
|
|
9
|
+
},
|
|
10
|
+
"name": "orchbee-agent-observation",
|
|
11
|
+
"version": "0.4.17",
|
|
12
|
+
"hooks": {
|
|
13
|
+
"SessionStart": [
|
|
14
|
+
{
|
|
15
|
+
"hooks": [
|
|
16
|
+
{
|
|
17
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
18
|
+
"timeout": 2000,
|
|
19
|
+
"type": "command",
|
|
20
|
+
"env": {
|
|
21
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"UserPromptSubmit": [
|
|
28
|
+
{
|
|
29
|
+
"hooks": [
|
|
30
|
+
{
|
|
31
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
32
|
+
"timeout": 2000,
|
|
33
|
+
"type": "command",
|
|
34
|
+
"env": {
|
|
35
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"PreToolUse": [
|
|
42
|
+
{
|
|
43
|
+
"matcher": ".*",
|
|
44
|
+
"hooks": [
|
|
45
|
+
{
|
|
46
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
47
|
+
"timeout": 2000,
|
|
48
|
+
"type": "command",
|
|
49
|
+
"env": {
|
|
50
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"PostToolUse": [
|
|
57
|
+
{
|
|
58
|
+
"matcher": ".*",
|
|
59
|
+
"hooks": [
|
|
60
|
+
{
|
|
61
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
62
|
+
"timeout": 2000,
|
|
63
|
+
"type": "command",
|
|
64
|
+
"env": {
|
|
65
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"PostToolUseFailure": [
|
|
72
|
+
{
|
|
73
|
+
"matcher": ".*",
|
|
74
|
+
"hooks": [
|
|
75
|
+
{
|
|
76
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
77
|
+
"timeout": 2000,
|
|
78
|
+
"type": "command",
|
|
79
|
+
"env": {
|
|
80
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"PermissionRequest": [
|
|
87
|
+
{
|
|
88
|
+
"matcher": ".*",
|
|
89
|
+
"hooks": [
|
|
90
|
+
{
|
|
91
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
92
|
+
"timeout": 2000,
|
|
93
|
+
"type": "command",
|
|
94
|
+
"env": {
|
|
95
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"PermissionDenied": [
|
|
102
|
+
{
|
|
103
|
+
"matcher": ".*",
|
|
104
|
+
"hooks": [
|
|
105
|
+
{
|
|
106
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
107
|
+
"timeout": 2000,
|
|
108
|
+
"type": "command",
|
|
109
|
+
"env": {
|
|
110
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"Notification": [
|
|
117
|
+
{
|
|
118
|
+
"matcher": "permission_prompt|idle_prompt",
|
|
119
|
+
"hooks": [
|
|
120
|
+
{
|
|
121
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
122
|
+
"timeout": 2000,
|
|
123
|
+
"type": "command",
|
|
124
|
+
"env": {
|
|
125
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"PreCompact": [
|
|
132
|
+
{
|
|
133
|
+
"hooks": [
|
|
134
|
+
{
|
|
135
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
136
|
+
"timeout": 2000,
|
|
137
|
+
"type": "command",
|
|
138
|
+
"env": {
|
|
139
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"PostCompact": [
|
|
146
|
+
{
|
|
147
|
+
"hooks": [
|
|
148
|
+
{
|
|
149
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
150
|
+
"timeout": 2000,
|
|
151
|
+
"type": "command",
|
|
152
|
+
"env": {
|
|
153
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
],
|
|
159
|
+
"SubagentStart": [
|
|
160
|
+
{
|
|
161
|
+
"matcher": ".*",
|
|
162
|
+
"hooks": [
|
|
163
|
+
{
|
|
164
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
165
|
+
"timeout": 2000,
|
|
166
|
+
"type": "command",
|
|
167
|
+
"env": {
|
|
168
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"SubagentStop": [
|
|
175
|
+
{
|
|
176
|
+
"hooks": [
|
|
177
|
+
{
|
|
178
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
179
|
+
"timeout": 2000,
|
|
180
|
+
"type": "command",
|
|
181
|
+
"env": {
|
|
182
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
],
|
|
188
|
+
"Stop": [
|
|
189
|
+
{
|
|
190
|
+
"hooks": [
|
|
191
|
+
{
|
|
192
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
193
|
+
"timeout": 2000,
|
|
194
|
+
"type": "command",
|
|
195
|
+
"env": {
|
|
196
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"StopFailure": [
|
|
203
|
+
{
|
|
204
|
+
"matcher": ".*",
|
|
205
|
+
"hooks": [
|
|
206
|
+
{
|
|
207
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
208
|
+
"timeout": 2000,
|
|
209
|
+
"type": "command",
|
|
210
|
+
"env": {
|
|
211
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
],
|
|
217
|
+
"SessionEnd": [
|
|
218
|
+
{
|
|
219
|
+
"hooks": [
|
|
220
|
+
{
|
|
221
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ3F3ZW4tY29kZSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
222
|
+
"timeout": 1000,
|
|
223
|
+
"type": "command",
|
|
224
|
+
"env": {
|
|
225
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
}
|
|
232
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { sanitizeAgentHookInput } from './hook-sanitizers.mjs';
|
|
2
|
+
import { forwardSanitizedObservation } from './observation-transport.mjs';
|
|
3
|
+
|
|
4
|
+
const MAX_INPUT_BYTES = 64 * 1024;
|
|
5
|
+
|
|
6
|
+
await main().catch(() => undefined);
|
|
7
|
+
|
|
8
|
+
async function main() {
|
|
9
|
+
const input = await readInput();
|
|
10
|
+
if (input === null) return;
|
|
11
|
+
let raw;
|
|
12
|
+
try {
|
|
13
|
+
raw = JSON.parse(input);
|
|
14
|
+
} catch {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const adapterId = process.argv[2];
|
|
18
|
+
const observation = sanitizeAgentHookInput(adapterId, raw);
|
|
19
|
+
if (observation === null) return;
|
|
20
|
+
await forwardSanitizedObservation(adapterId, observation);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async function readInput() {
|
|
24
|
+
const chunks = [];
|
|
25
|
+
let byteLength = 0;
|
|
26
|
+
for await (const chunk of process.stdin) {
|
|
27
|
+
const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
28
|
+
byteLength += bytes.byteLength;
|
|
29
|
+
if (byteLength > MAX_INPUT_BYTES) return null;
|
|
30
|
+
chunks.push(bytes);
|
|
31
|
+
}
|
|
32
|
+
return Buffer.concat(chunks, byteLength).toString('utf8');
|
|
33
|
+
}
|