@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,187 @@
|
|
|
1
|
+
import { forwardSanitizedObservation } from '../scripts/observation-transport.mjs';
|
|
2
|
+
|
|
3
|
+
export const CLINE_COMPLETION_RETENTION = Object.freeze({
|
|
4
|
+
completedRunsPerConversation: 64,
|
|
5
|
+
conversations: 128,
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
// `rootSessionKey` is the root session id Cline hands to `setup`; it is the id
|
|
9
|
+
// `cline --id` resumes. Without it the conversation id stands in, which no
|
|
10
|
+
// resume accepts.
|
|
11
|
+
export function sanitizeClineRuntimeEvent(value, rootSessionKey = null) {
|
|
12
|
+
if (!isRecord(value) || !isRecord(value.snapshot)) return null;
|
|
13
|
+
// Subagent runs carry their parent Agent; they would otherwise read as extra root sessions.
|
|
14
|
+
const parentAgentId = value.snapshot.parentAgentId;
|
|
15
|
+
if (typeof parentAgentId === 'string' && parentAgentId !== '') return null;
|
|
16
|
+
const sessionKey = rootSessionKey ?? identity(value.snapshot.conversationId);
|
|
17
|
+
const turnKey = identity(value.snapshot.runId);
|
|
18
|
+
if (sessionKey === null || turnKey === null) return null;
|
|
19
|
+
|
|
20
|
+
switch (value.type) {
|
|
21
|
+
case 'run-started':
|
|
22
|
+
case 'turn-started':
|
|
23
|
+
return observation(sessionKey, 'turn-started', { activity: 'thinking', turnKey });
|
|
24
|
+
case 'tool-started': {
|
|
25
|
+
if (!isRecord(value.toolCall)) return null;
|
|
26
|
+
const operationKey = identity(value.toolCall.toolCallId);
|
|
27
|
+
const toolName = identity(value.toolCall.toolName);
|
|
28
|
+
if (operationKey === null) return null;
|
|
29
|
+
return observation(
|
|
30
|
+
sessionKey,
|
|
31
|
+
toolName === 'ask_question' ? 'question-requested' : 'tool-started',
|
|
32
|
+
{
|
|
33
|
+
activity: toolName === 'ask_question' ? null : clineToolActivity(toolName),
|
|
34
|
+
operationKey,
|
|
35
|
+
turnKey,
|
|
36
|
+
},
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
case 'tool-finished': {
|
|
40
|
+
if (!isRecord(value.toolCall)) return null;
|
|
41
|
+
const operationKey = identity(value.toolCall.toolCallId);
|
|
42
|
+
if (operationKey === null) return null;
|
|
43
|
+
return observation(
|
|
44
|
+
sessionKey,
|
|
45
|
+
toolResultFailed(value.message, operationKey) ? 'tool-failed' : 'tool-finished',
|
|
46
|
+
{ operationKey, turnKey },
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
case 'run-finished':
|
|
50
|
+
if (!isRecord(value.result)) return null;
|
|
51
|
+
switch (value.result.status) {
|
|
52
|
+
case 'completed':
|
|
53
|
+
return observation(sessionKey, 'turn-stopped', { turnKey });
|
|
54
|
+
case 'aborted':
|
|
55
|
+
return observation(sessionKey, 'turn-interrupted', { turnKey });
|
|
56
|
+
case 'failed':
|
|
57
|
+
return observation(sessionKey, 'turn-failed', { turnKey });
|
|
58
|
+
default:
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
case 'run-failed':
|
|
62
|
+
return observation(sessionKey, 'turn-failed', { turnKey });
|
|
63
|
+
default:
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function createClineRuntimeEventDelivery() {
|
|
69
|
+
const completedRunsByConversation = new Map();
|
|
70
|
+
return (value, deliver = deliverObservation, rootSessionKey = null) => {
|
|
71
|
+
const normalized = sanitizeClineRuntimeEvent(value, rootSessionKey);
|
|
72
|
+
if (normalized === null) return;
|
|
73
|
+
if (
|
|
74
|
+
completedRunIsRetained(completedRunsByConversation, normalized.sessionKey, normalized.turnKey)
|
|
75
|
+
) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (isClineCompletionEvent(normalized.event)) {
|
|
79
|
+
// A synchronous delivery sink may reenter with an older event for this run.
|
|
80
|
+
rememberCompletedRun(completedRunsByConversation, normalized.sessionKey, normalized.turnKey);
|
|
81
|
+
}
|
|
82
|
+
deliver(normalized);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Cline loads each sandboxed plugin once per session, so one plugin instance
|
|
87
|
+
// serves one root session. If `setup` ever reports a missing or different id,
|
|
88
|
+
// the instance is shared and no event can be attributed: fall back for good.
|
|
89
|
+
export function createClinePlugin(deliver = deliverObservation) {
|
|
90
|
+
const deliverRuntimeEvent = createClineRuntimeEventDelivery();
|
|
91
|
+
let rootSessionKey = null;
|
|
92
|
+
let setupCount = 0;
|
|
93
|
+
return {
|
|
94
|
+
hooks: {
|
|
95
|
+
onEvent(value) {
|
|
96
|
+
deliverRuntimeEvent(value, deliver, rootSessionKey);
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
manifest: { capabilities: ['hooks'] },
|
|
100
|
+
name: 'orchbee-agent-observation',
|
|
101
|
+
setup(_api, ctx) {
|
|
102
|
+
const reported =
|
|
103
|
+
isRecord(ctx) && isRecord(ctx.session) ? identity(ctx.session.sessionId) : null;
|
|
104
|
+
setupCount += 1;
|
|
105
|
+
rootSessionKey = setupCount === 1 || reported === rootSessionKey ? reported : null;
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export const plugin = createClinePlugin();
|
|
111
|
+
|
|
112
|
+
function deliverObservation(value) {
|
|
113
|
+
void forwardSanitizedObservation('cline', value).catch(() => undefined);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function completedRunIsRetained(completedRunsByConversation, conversationId, runId) {
|
|
117
|
+
const completedRuns = completedRunsByConversation.get(conversationId);
|
|
118
|
+
return completedRuns?.has(runId) === true;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function isClineCompletionEvent(event) {
|
|
122
|
+
return event === 'turn-stopped' || event === 'turn-failed' || event === 'turn-interrupted';
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function rememberCompletedRun(completedRunsByConversation, conversationId, runId) {
|
|
126
|
+
let completedRuns = completedRunsByConversation.get(conversationId);
|
|
127
|
+
if (completedRuns === undefined) {
|
|
128
|
+
if (completedRunsByConversation.size >= CLINE_COMPLETION_RETENTION.conversations) {
|
|
129
|
+
const oldestConversationId = completedRunsByConversation.keys().next().value;
|
|
130
|
+
if (oldestConversationId !== undefined) {
|
|
131
|
+
completedRunsByConversation.delete(oldestConversationId);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
completedRuns = new Set();
|
|
135
|
+
} else {
|
|
136
|
+
completedRunsByConversation.delete(conversationId);
|
|
137
|
+
}
|
|
138
|
+
if (completedRuns.size >= CLINE_COMPLETION_RETENTION.completedRunsPerConversation) {
|
|
139
|
+
const oldestRunId = completedRuns.values().next().value;
|
|
140
|
+
if (oldestRunId !== undefined) completedRuns.delete(oldestRunId);
|
|
141
|
+
}
|
|
142
|
+
completedRuns.add(runId);
|
|
143
|
+
completedRunsByConversation.set(conversationId, completedRuns);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function toolResultFailed(value, operationKey) {
|
|
147
|
+
if (!isRecord(value) || !Array.isArray(value.content)) return false;
|
|
148
|
+
for (const part of value.content) {
|
|
149
|
+
if (
|
|
150
|
+
isRecord(part) &&
|
|
151
|
+
part.type === 'tool-result' &&
|
|
152
|
+
part.toolCallId === operationKey &&
|
|
153
|
+
part.isError === true
|
|
154
|
+
) {
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function clineToolActivity(toolName) {
|
|
162
|
+
if (toolName === 'bash' || toolName === 'execute_command') return 'command';
|
|
163
|
+
if (toolName === 'edit_file' || toolName === 'replace_in_file' || toolName === 'write_to_file') {
|
|
164
|
+
return 'editing';
|
|
165
|
+
}
|
|
166
|
+
return 'tool';
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function observation(sessionKey, event, fields = {}) {
|
|
170
|
+
return {
|
|
171
|
+
activity: fields.activity ?? null,
|
|
172
|
+
agentKey: null,
|
|
173
|
+
event,
|
|
174
|
+
operationKey: fields.operationKey ?? null,
|
|
175
|
+
sessionKey,
|
|
176
|
+
turnKey: fields.turnKey ?? null,
|
|
177
|
+
version: 1,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function identity(value) {
|
|
182
|
+
return typeof value === 'string' && /^[A-Za-z0-9._:-]{1,128}$/u.test(value) ? value : null;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function isRecord(value) {
|
|
186
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
187
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"hooks": [
|
|
6
|
+
{
|
|
7
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ2dlbWluaSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
8
|
+
"timeout": 2000,
|
|
9
|
+
"type": "command",
|
|
10
|
+
"env": {
|
|
11
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"BeforeAgent": [
|
|
18
|
+
{
|
|
19
|
+
"hooks": [
|
|
20
|
+
{
|
|
21
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ2dlbWluaSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
22
|
+
"timeout": 2000,
|
|
23
|
+
"type": "command",
|
|
24
|
+
"env": {
|
|
25
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"BeforeTool": [
|
|
32
|
+
{
|
|
33
|
+
"matcher": ".*",
|
|
34
|
+
"hooks": [
|
|
35
|
+
{
|
|
36
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ2dlbWluaSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
37
|
+
"timeout": 2000,
|
|
38
|
+
"type": "command",
|
|
39
|
+
"env": {
|
|
40
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"AfterTool": [
|
|
47
|
+
{
|
|
48
|
+
"matcher": ".*",
|
|
49
|
+
"hooks": [
|
|
50
|
+
{
|
|
51
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ2dlbWluaSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
52
|
+
"timeout": 2000,
|
|
53
|
+
"type": "command",
|
|
54
|
+
"env": {
|
|
55
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"Notification": [
|
|
62
|
+
{
|
|
63
|
+
"hooks": [
|
|
64
|
+
{
|
|
65
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ2dlbWluaSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
66
|
+
"timeout": 2000,
|
|
67
|
+
"type": "command",
|
|
68
|
+
"env": {
|
|
69
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"PreCompress": [
|
|
76
|
+
{
|
|
77
|
+
"hooks": [
|
|
78
|
+
{
|
|
79
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ2dlbWluaSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
80
|
+
"timeout": 2000,
|
|
81
|
+
"type": "command",
|
|
82
|
+
"env": {
|
|
83
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"AfterAgent": [
|
|
90
|
+
{
|
|
91
|
+
"hooks": [
|
|
92
|
+
{
|
|
93
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ2dlbWluaSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
94
|
+
"timeout": 2000,
|
|
95
|
+
"type": "command",
|
|
96
|
+
"env": {
|
|
97
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"SessionEnd": [
|
|
104
|
+
{
|
|
105
|
+
"hooks": [
|
|
106
|
+
{
|
|
107
|
+
"command": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3Qgcm9vdD1wcm9jZXNzLmVudi5PUkNIQkVFX0FHRU5UX0VYVEVOU0lPTl9ST09UO2lmKCFyb290fHwhcmVxdWlyZSgnbm9kZTpwYXRoJykuaXNBYnNvbHV0ZShyb290KSlyZXR1cm47Y29uc3QgZmlsZT1yZXF1aXJlKCdub2RlOnBhdGgnKS5qb2luKHJvb3QsJ3NjcmlwdHMnLCdmb3J3YXJkLWhvb2subWpzJyk7cHJvY2Vzcy5hcmd2PVtwcm9jZXNzLmV4ZWNQYXRoLGZpbGUsJ2dlbWluaSddO2F3YWl0IGltcG9ydChyZXF1aXJlKCdub2RlOnVybCcpLnBhdGhUb0ZpbGVVUkwoZmlsZSkuaHJlZil9Y2F0Y2h7fX0pKCk=','base64').toString('utf8'))\"",
|
|
108
|
+
"timeout": 1000,
|
|
109
|
+
"type": "command",
|
|
110
|
+
"env": {
|
|
111
|
+
"ORCHBEE_AGENT_EXTENSION_ROOT": "${extensionPath}"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Content-free Hermes session identity; stdlib-only, bounded and silent."""
|
|
2
|
+
from functools import partial
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
import re
|
|
7
|
+
import subprocess
|
|
8
|
+
|
|
9
|
+
_ID = re.compile(r"[A-Za-z0-9._:-]{1,128}\Z")
|
|
10
|
+
_PLATFORMS = {"cli", "tui", "desktop", "acp"}
|
|
11
|
+
_SCRIPT = Path(__file__).resolve().parent.parent / "scripts" / "forward-hook.mjs"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _report(event, **kwargs):
|
|
15
|
+
platform = kwargs.get("platform")
|
|
16
|
+
session = kwargs.get("session_id")
|
|
17
|
+
if not isinstance(platform, str) or platform not in _PLATFORMS:
|
|
18
|
+
return
|
|
19
|
+
if event == "pre_llm_call" and platform != "cli":
|
|
20
|
+
return
|
|
21
|
+
if not isinstance(session, str) or _ID.fullmatch(session) is None:
|
|
22
|
+
return
|
|
23
|
+
payload = json.dumps({"event": event, "platform": platform, "session_id": session}).encode("utf-8")
|
|
24
|
+
try:
|
|
25
|
+
subprocess.run(
|
|
26
|
+
["node", str(_SCRIPT), "hermes"],
|
|
27
|
+
input=payload,
|
|
28
|
+
stdout=subprocess.DEVNULL,
|
|
29
|
+
stderr=subprocess.DEVNULL,
|
|
30
|
+
timeout=2,
|
|
31
|
+
check=False,
|
|
32
|
+
creationflags=subprocess.CREATE_NO_WINDOW if os.name == "nt" else 0,
|
|
33
|
+
)
|
|
34
|
+
except (OSError, subprocess.SubprocessError):
|
|
35
|
+
pass
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def register(ctx):
|
|
39
|
+
for event in ("on_session_start", "on_session_reset", "pre_llm_call"):
|
|
40
|
+
ctx.register_hook(event, partial(_report, event))
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Content-free Orchbee Agent status observation for Codex",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"SessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"command": "command -v node >/dev/null 2>&1 && [ -r \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" ] && node \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" codex >/dev/null 2>&1 || :",
|
|
9
|
+
"timeout": 2,
|
|
10
|
+
"type": "command",
|
|
11
|
+
"commandWindows": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3QgcD1hd2FpdCBpbXBvcnQoJ25vZGU6cGF0aCcpO2xldCByPXByb2Nlc3MuZW52LlBMVUdJTl9ST09UO2lmKHR5cGVvZiByIT09J3N0cmluZycpcmV0dXJuO2lmKC9eXFxcXFw/XFxVTkNcXC9pLnRlc3Qocikpcj0nXFxcXCcrci5zbGljZSg4KTtlbHNlIGlmKC9eXFxcXFw/XFxbQS1aYS16XTpcXC8udGVzdChyKSlyPXIuc2xpY2UoNCk7aWYoIXAuaXNBYnNvbHV0ZShyKSlyZXR1cm47Y29uc3Qgcz1wLmpvaW4ociwnc2NyaXB0cycsJ2ZvcndhcmQtaG9vay5tanMnKTtwcm9jZXNzLmFyZ3Y9W3Byb2Nlc3MuYXJndlswXSxzLCdjb2RleCddO2F3YWl0IGltcG9ydCgoYXdhaXQgaW1wb3J0KCdub2RlOnVybCcpKS5wYXRoVG9GaWxlVVJMKHMpLmhyZWYpfWNhdGNoe319KSgp','base64').toString('utf8'))\""
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"UserPromptSubmit": [
|
|
17
|
+
{
|
|
18
|
+
"hooks": [
|
|
19
|
+
{
|
|
20
|
+
"command": "command -v node >/dev/null 2>&1 && [ -r \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" ] && node \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" codex >/dev/null 2>&1 || :",
|
|
21
|
+
"timeout": 2,
|
|
22
|
+
"type": "command",
|
|
23
|
+
"commandWindows": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3QgcD1hd2FpdCBpbXBvcnQoJ25vZGU6cGF0aCcpO2xldCByPXByb2Nlc3MuZW52LlBMVUdJTl9ST09UO2lmKHR5cGVvZiByIT09J3N0cmluZycpcmV0dXJuO2lmKC9eXFxcXFw/XFxVTkNcXC9pLnRlc3Qocikpcj0nXFxcXCcrci5zbGljZSg4KTtlbHNlIGlmKC9eXFxcXFw/XFxbQS1aYS16XTpcXC8udGVzdChyKSlyPXIuc2xpY2UoNCk7aWYoIXAuaXNBYnNvbHV0ZShyKSlyZXR1cm47Y29uc3Qgcz1wLmpvaW4ociwnc2NyaXB0cycsJ2ZvcndhcmQtaG9vay5tanMnKTtwcm9jZXNzLmFyZ3Y9W3Byb2Nlc3MuYXJndlswXSxzLCdjb2RleCddO2F3YWl0IGltcG9ydCgoYXdhaXQgaW1wb3J0KCdub2RlOnVybCcpKS5wYXRoVG9GaWxlVVJMKHMpLmhyZWYpfWNhdGNoe319KSgp','base64').toString('utf8'))\""
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"PreToolUse": [
|
|
29
|
+
{
|
|
30
|
+
"matcher": "*",
|
|
31
|
+
"hooks": [
|
|
32
|
+
{
|
|
33
|
+
"command": "command -v node >/dev/null 2>&1 && [ -r \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" ] && node \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" codex >/dev/null 2>&1 || :",
|
|
34
|
+
"timeout": 2,
|
|
35
|
+
"type": "command",
|
|
36
|
+
"commandWindows": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3QgcD1hd2FpdCBpbXBvcnQoJ25vZGU6cGF0aCcpO2xldCByPXByb2Nlc3MuZW52LlBMVUdJTl9ST09UO2lmKHR5cGVvZiByIT09J3N0cmluZycpcmV0dXJuO2lmKC9eXFxcXFw/XFxVTkNcXC9pLnRlc3Qocikpcj0nXFxcXCcrci5zbGljZSg4KTtlbHNlIGlmKC9eXFxcXFw/XFxbQS1aYS16XTpcXC8udGVzdChyKSlyPXIuc2xpY2UoNCk7aWYoIXAuaXNBYnNvbHV0ZShyKSlyZXR1cm47Y29uc3Qgcz1wLmpvaW4ociwnc2NyaXB0cycsJ2ZvcndhcmQtaG9vay5tanMnKTtwcm9jZXNzLmFyZ3Y9W3Byb2Nlc3MuYXJndlswXSxzLCdjb2RleCddO2F3YWl0IGltcG9ydCgoYXdhaXQgaW1wb3J0KCdub2RlOnVybCcpKS5wYXRoVG9GaWxlVVJMKHMpLmhyZWYpfWNhdGNoe319KSgp','base64').toString('utf8'))\""
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"PermissionRequest": [
|
|
42
|
+
{
|
|
43
|
+
"matcher": "*",
|
|
44
|
+
"hooks": [
|
|
45
|
+
{
|
|
46
|
+
"command": "command -v node >/dev/null 2>&1 && [ -r \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" ] && node \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" codex >/dev/null 2>&1 || :",
|
|
47
|
+
"timeout": 2,
|
|
48
|
+
"type": "command",
|
|
49
|
+
"commandWindows": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3QgcD1hd2FpdCBpbXBvcnQoJ25vZGU6cGF0aCcpO2xldCByPXByb2Nlc3MuZW52LlBMVUdJTl9ST09UO2lmKHR5cGVvZiByIT09J3N0cmluZycpcmV0dXJuO2lmKC9eXFxcXFw/XFxVTkNcXC9pLnRlc3Qocikpcj0nXFxcXCcrci5zbGljZSg4KTtlbHNlIGlmKC9eXFxcXFw/XFxbQS1aYS16XTpcXC8udGVzdChyKSlyPXIuc2xpY2UoNCk7aWYoIXAuaXNBYnNvbHV0ZShyKSlyZXR1cm47Y29uc3Qgcz1wLmpvaW4ociwnc2NyaXB0cycsJ2ZvcndhcmQtaG9vay5tanMnKTtwcm9jZXNzLmFyZ3Y9W3Byb2Nlc3MuYXJndlswXSxzLCdjb2RleCddO2F3YWl0IGltcG9ydCgoYXdhaXQgaW1wb3J0KCdub2RlOnVybCcpKS5wYXRoVG9GaWxlVVJMKHMpLmhyZWYpfWNhdGNoe319KSgp','base64').toString('utf8'))\""
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"PostToolUse": [
|
|
55
|
+
{
|
|
56
|
+
"matcher": "*",
|
|
57
|
+
"hooks": [
|
|
58
|
+
{
|
|
59
|
+
"command": "command -v node >/dev/null 2>&1 && [ -r \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" ] && node \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" codex >/dev/null 2>&1 || :",
|
|
60
|
+
"timeout": 2,
|
|
61
|
+
"type": "command",
|
|
62
|
+
"commandWindows": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3QgcD1hd2FpdCBpbXBvcnQoJ25vZGU6cGF0aCcpO2xldCByPXByb2Nlc3MuZW52LlBMVUdJTl9ST09UO2lmKHR5cGVvZiByIT09J3N0cmluZycpcmV0dXJuO2lmKC9eXFxcXFw/XFxVTkNcXC9pLnRlc3Qocikpcj0nXFxcXCcrci5zbGljZSg4KTtlbHNlIGlmKC9eXFxcXFw/XFxbQS1aYS16XTpcXC8udGVzdChyKSlyPXIuc2xpY2UoNCk7aWYoIXAuaXNBYnNvbHV0ZShyKSlyZXR1cm47Y29uc3Qgcz1wLmpvaW4ociwnc2NyaXB0cycsJ2ZvcndhcmQtaG9vay5tanMnKTtwcm9jZXNzLmFyZ3Y9W3Byb2Nlc3MuYXJndlswXSxzLCdjb2RleCddO2F3YWl0IGltcG9ydCgoYXdhaXQgaW1wb3J0KCdub2RlOnVybCcpKS5wYXRoVG9GaWxlVVJMKHMpLmhyZWYpfWNhdGNoe319KSgp','base64').toString('utf8'))\""
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"PreCompact": [
|
|
68
|
+
{
|
|
69
|
+
"hooks": [
|
|
70
|
+
{
|
|
71
|
+
"command": "command -v node >/dev/null 2>&1 && [ -r \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" ] && node \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" codex >/dev/null 2>&1 || :",
|
|
72
|
+
"timeout": 2,
|
|
73
|
+
"type": "command",
|
|
74
|
+
"commandWindows": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3QgcD1hd2FpdCBpbXBvcnQoJ25vZGU6cGF0aCcpO2xldCByPXByb2Nlc3MuZW52LlBMVUdJTl9ST09UO2lmKHR5cGVvZiByIT09J3N0cmluZycpcmV0dXJuO2lmKC9eXFxcXFw/XFxVTkNcXC9pLnRlc3Qocikpcj0nXFxcXCcrci5zbGljZSg4KTtlbHNlIGlmKC9eXFxcXFw/XFxbQS1aYS16XTpcXC8udGVzdChyKSlyPXIuc2xpY2UoNCk7aWYoIXAuaXNBYnNvbHV0ZShyKSlyZXR1cm47Y29uc3Qgcz1wLmpvaW4ociwnc2NyaXB0cycsJ2ZvcndhcmQtaG9vay5tanMnKTtwcm9jZXNzLmFyZ3Y9W3Byb2Nlc3MuYXJndlswXSxzLCdjb2RleCddO2F3YWl0IGltcG9ydCgoYXdhaXQgaW1wb3J0KCdub2RlOnVybCcpKS5wYXRoVG9GaWxlVVJMKHMpLmhyZWYpfWNhdGNoe319KSgp','base64').toString('utf8'))\""
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"PostCompact": [
|
|
80
|
+
{
|
|
81
|
+
"hooks": [
|
|
82
|
+
{
|
|
83
|
+
"command": "command -v node >/dev/null 2>&1 && [ -r \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" ] && node \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" codex >/dev/null 2>&1 || :",
|
|
84
|
+
"timeout": 2,
|
|
85
|
+
"type": "command",
|
|
86
|
+
"commandWindows": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3QgcD1hd2FpdCBpbXBvcnQoJ25vZGU6cGF0aCcpO2xldCByPXByb2Nlc3MuZW52LlBMVUdJTl9ST09UO2lmKHR5cGVvZiByIT09J3N0cmluZycpcmV0dXJuO2lmKC9eXFxcXFw/XFxVTkNcXC9pLnRlc3Qocikpcj0nXFxcXCcrci5zbGljZSg4KTtlbHNlIGlmKC9eXFxcXFw/XFxbQS1aYS16XTpcXC8udGVzdChyKSlyPXIuc2xpY2UoNCk7aWYoIXAuaXNBYnNvbHV0ZShyKSlyZXR1cm47Y29uc3Qgcz1wLmpvaW4ociwnc2NyaXB0cycsJ2ZvcndhcmQtaG9vay5tanMnKTtwcm9jZXNzLmFyZ3Y9W3Byb2Nlc3MuYXJndlswXSxzLCdjb2RleCddO2F3YWl0IGltcG9ydCgoYXdhaXQgaW1wb3J0KCdub2RlOnVybCcpKS5wYXRoVG9GaWxlVVJMKHMpLmhyZWYpfWNhdGNoe319KSgp','base64').toString('utf8'))\""
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"SubagentStart": [
|
|
92
|
+
{
|
|
93
|
+
"matcher": "*",
|
|
94
|
+
"hooks": [
|
|
95
|
+
{
|
|
96
|
+
"command": "command -v node >/dev/null 2>&1 && [ -r \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" ] && node \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" codex >/dev/null 2>&1 || :",
|
|
97
|
+
"timeout": 2,
|
|
98
|
+
"type": "command",
|
|
99
|
+
"commandWindows": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3QgcD1hd2FpdCBpbXBvcnQoJ25vZGU6cGF0aCcpO2xldCByPXByb2Nlc3MuZW52LlBMVUdJTl9ST09UO2lmKHR5cGVvZiByIT09J3N0cmluZycpcmV0dXJuO2lmKC9eXFxcXFw/XFxVTkNcXC9pLnRlc3Qocikpcj0nXFxcXCcrci5zbGljZSg4KTtlbHNlIGlmKC9eXFxcXFw/XFxbQS1aYS16XTpcXC8udGVzdChyKSlyPXIuc2xpY2UoNCk7aWYoIXAuaXNBYnNvbHV0ZShyKSlyZXR1cm47Y29uc3Qgcz1wLmpvaW4ociwnc2NyaXB0cycsJ2ZvcndhcmQtaG9vay5tanMnKTtwcm9jZXNzLmFyZ3Y9W3Byb2Nlc3MuYXJndlswXSxzLCdjb2RleCddO2F3YWl0IGltcG9ydCgoYXdhaXQgaW1wb3J0KCdub2RlOnVybCcpKS5wYXRoVG9GaWxlVVJMKHMpLmhyZWYpfWNhdGNoe319KSgp','base64').toString('utf8'))\""
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
"SubagentStop": [
|
|
105
|
+
{
|
|
106
|
+
"matcher": "*",
|
|
107
|
+
"hooks": [
|
|
108
|
+
{
|
|
109
|
+
"command": "command -v node >/dev/null 2>&1 && [ -r \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" ] && node \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" codex >/dev/null 2>&1 || :",
|
|
110
|
+
"timeout": 2,
|
|
111
|
+
"type": "command",
|
|
112
|
+
"commandWindows": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3QgcD1hd2FpdCBpbXBvcnQoJ25vZGU6cGF0aCcpO2xldCByPXByb2Nlc3MuZW52LlBMVUdJTl9ST09UO2lmKHR5cGVvZiByIT09J3N0cmluZycpcmV0dXJuO2lmKC9eXFxcXFw/XFxVTkNcXC9pLnRlc3Qocikpcj0nXFxcXCcrci5zbGljZSg4KTtlbHNlIGlmKC9eXFxcXFw/XFxbQS1aYS16XTpcXC8udGVzdChyKSlyPXIuc2xpY2UoNCk7aWYoIXAuaXNBYnNvbHV0ZShyKSlyZXR1cm47Y29uc3Qgcz1wLmpvaW4ociwnc2NyaXB0cycsJ2ZvcndhcmQtaG9vay5tanMnKTtwcm9jZXNzLmFyZ3Y9W3Byb2Nlc3MuYXJndlswXSxzLCdjb2RleCddO2F3YWl0IGltcG9ydCgoYXdhaXQgaW1wb3J0KCdub2RlOnVybCcpKS5wYXRoVG9GaWxlVVJMKHMpLmhyZWYpfWNhdGNoe319KSgp','base64').toString('utf8'))\""
|
|
113
|
+
}
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"Stop": [
|
|
118
|
+
{
|
|
119
|
+
"hooks": [
|
|
120
|
+
{
|
|
121
|
+
"command": "command -v node >/dev/null 2>&1 && [ -r \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" ] && node \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" codex >/dev/null 2>&1 || :",
|
|
122
|
+
"timeout": 2,
|
|
123
|
+
"type": "command",
|
|
124
|
+
"commandWindows": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3QgcD1hd2FpdCBpbXBvcnQoJ25vZGU6cGF0aCcpO2xldCByPXByb2Nlc3MuZW52LlBMVUdJTl9ST09UO2lmKHR5cGVvZiByIT09J3N0cmluZycpcmV0dXJuO2lmKC9eXFxcXFw/XFxVTkNcXC9pLnRlc3Qocikpcj0nXFxcXCcrci5zbGljZSg4KTtlbHNlIGlmKC9eXFxcXFw/XFxbQS1aYS16XTpcXC8udGVzdChyKSlyPXIuc2xpY2UoNCk7aWYoIXAuaXNBYnNvbHV0ZShyKSlyZXR1cm47Y29uc3Qgcz1wLmpvaW4ociwnc2NyaXB0cycsJ2ZvcndhcmQtaG9vay5tanMnKTtwcm9jZXNzLmFyZ3Y9W3Byb2Nlc3MuYXJndlswXSxzLCdjb2RleCddO2F3YWl0IGltcG9ydCgoYXdhaXQgaW1wb3J0KCdub2RlOnVybCcpKS5wYXRoVG9GaWxlVVJMKHMpLmhyZWYpfWNhdGNoe319KSgp','base64').toString('utf8'))\""
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"SessionEnd": [
|
|
130
|
+
{
|
|
131
|
+
"hooks": [
|
|
132
|
+
{
|
|
133
|
+
"command": "command -v node >/dev/null 2>&1 && [ -r \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" ] && node \"${PLUGIN_ROOT}/scripts/forward-hook.mjs\" codex >/dev/null 2>&1 || :",
|
|
134
|
+
"timeout": 1,
|
|
135
|
+
"type": "command",
|
|
136
|
+
"commandWindows": "node -e \"eval(Buffer.from('KGFzeW5jKCk9Pnt0cnl7Y29uc3QgcD1hd2FpdCBpbXBvcnQoJ25vZGU6cGF0aCcpO2xldCByPXByb2Nlc3MuZW52LlBMVUdJTl9ST09UO2lmKHR5cGVvZiByIT09J3N0cmluZycpcmV0dXJuO2lmKC9eXFxcXFw/XFxVTkNcXC9pLnRlc3Qocikpcj0nXFxcXCcrci5zbGljZSg4KTtlbHNlIGlmKC9eXFxcXFw/XFxbQS1aYS16XTpcXC8udGVzdChyKSlyPXIuc2xpY2UoNCk7aWYoIXAuaXNBYnNvbHV0ZShyKSlyZXR1cm47Y29uc3Qgcz1wLmpvaW4ociwnc2NyaXB0cycsJ2ZvcndhcmQtaG9vay5tanMnKTtwcm9jZXNzLmFyZ3Y9W3Byb2Nlc3MuYXJndlswXSxzLCdjb2RleCddO2F3YWl0IGltcG9ydCgoYXdhaXQgaW1wb3J0KCdub2RlOnVybCcpKS5wYXRoVG9GaWxlVVJMKHMpLmhyZWYpfWNhdGNoe319KSgp','base64').toString('utf8'))\""
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"hooks": {
|
|
4
|
+
"SessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"timeoutSec": 2,
|
|
7
|
+
"type": "command",
|
|
8
|
+
"exec": "node",
|
|
9
|
+
"args": [
|
|
10
|
+
"--input-type=module",
|
|
11
|
+
"-e",
|
|
12
|
+
"try { const p = await import('node:path'); const r = process.env.COPILOT_PLUGIN_ROOT; if (typeof r === 'string' && p.isAbsolute(r)) { const s = p.join(r, 'scripts', 'forward-hook.mjs'); process.argv = [process.argv[0], s, 'github-copilot']; await import((await import('node:url')).pathToFileURL(s).href); } } catch {}"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"UserPromptSubmit": [
|
|
17
|
+
{
|
|
18
|
+
"timeoutSec": 2,
|
|
19
|
+
"type": "command",
|
|
20
|
+
"exec": "node",
|
|
21
|
+
"args": [
|
|
22
|
+
"--input-type=module",
|
|
23
|
+
"-e",
|
|
24
|
+
"try { const p = await import('node:path'); const r = process.env.COPILOT_PLUGIN_ROOT; if (typeof r === 'string' && p.isAbsolute(r)) { const s = p.join(r, 'scripts', 'forward-hook.mjs'); process.argv = [process.argv[0], s, 'github-copilot']; await import((await import('node:url')).pathToFileURL(s).href); } } catch {}"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"PostToolUse": [
|
|
29
|
+
{
|
|
30
|
+
"timeoutSec": 2,
|
|
31
|
+
"type": "command",
|
|
32
|
+
"exec": "node",
|
|
33
|
+
"args": [
|
|
34
|
+
"--input-type=module",
|
|
35
|
+
"-e",
|
|
36
|
+
"try { const p = await import('node:path'); const r = process.env.COPILOT_PLUGIN_ROOT; if (typeof r === 'string' && p.isAbsolute(r)) { const s = p.join(r, 'scripts', 'forward-hook.mjs'); process.argv = [process.argv[0], s, 'github-copilot']; await import((await import('node:url')).pathToFileURL(s).href); } } catch {}"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"PostToolUseFailure": [
|
|
41
|
+
{
|
|
42
|
+
"timeoutSec": 2,
|
|
43
|
+
"type": "command",
|
|
44
|
+
"exec": "node",
|
|
45
|
+
"args": [
|
|
46
|
+
"--input-type=module",
|
|
47
|
+
"-e",
|
|
48
|
+
"try { const p = await import('node:path'); const r = process.env.COPILOT_PLUGIN_ROOT; if (typeof r === 'string' && p.isAbsolute(r)) { const s = p.join(r, 'scripts', 'forward-hook.mjs'); process.argv = [process.argv[0], s, 'github-copilot']; await import((await import('node:url')).pathToFileURL(s).href); } } catch {}"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"Notification": [
|
|
53
|
+
{
|
|
54
|
+
"matcher": "permission_prompt|elicitation_dialog",
|
|
55
|
+
"timeoutSec": 2,
|
|
56
|
+
"type": "command",
|
|
57
|
+
"exec": "node",
|
|
58
|
+
"args": [
|
|
59
|
+
"--input-type=module",
|
|
60
|
+
"-e",
|
|
61
|
+
"try { const p = await import('node:path'); const r = process.env.COPILOT_PLUGIN_ROOT; if (typeof r === 'string' && p.isAbsolute(r)) { const s = p.join(r, 'scripts', 'forward-hook.mjs'); process.argv = [process.argv[0], s, 'github-copilot']; await import((await import('node:url')).pathToFileURL(s).href); } } catch {}"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"PreCompact": [
|
|
66
|
+
{
|
|
67
|
+
"timeoutSec": 2,
|
|
68
|
+
"type": "command",
|
|
69
|
+
"exec": "node",
|
|
70
|
+
"args": [
|
|
71
|
+
"--input-type=module",
|
|
72
|
+
"-e",
|
|
73
|
+
"try { const p = await import('node:path'); const r = process.env.COPILOT_PLUGIN_ROOT; if (typeof r === 'string' && p.isAbsolute(r)) { const s = p.join(r, 'scripts', 'forward-hook.mjs'); process.argv = [process.argv[0], s, 'github-copilot']; await import((await import('node:url')).pathToFileURL(s).href); } } catch {}"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"Stop": [
|
|
78
|
+
{
|
|
79
|
+
"timeoutSec": 2,
|
|
80
|
+
"type": "command",
|
|
81
|
+
"exec": "node",
|
|
82
|
+
"args": [
|
|
83
|
+
"--input-type=module",
|
|
84
|
+
"-e",
|
|
85
|
+
"try { const p = await import('node:path'); const r = process.env.COPILOT_PLUGIN_ROOT; if (typeof r === 'string' && p.isAbsolute(r)) { const s = p.join(r, 'scripts', 'forward-hook.mjs'); process.argv = [process.argv[0], s, 'github-copilot']; await import((await import('node:url')).pathToFileURL(s).href); } } catch {}"
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"ErrorOccurred": [
|
|
90
|
+
{
|
|
91
|
+
"timeoutSec": 2,
|
|
92
|
+
"type": "command",
|
|
93
|
+
"exec": "node",
|
|
94
|
+
"args": [
|
|
95
|
+
"--input-type=module",
|
|
96
|
+
"-e",
|
|
97
|
+
"try { const p = await import('node:path'); const r = process.env.COPILOT_PLUGIN_ROOT; if (typeof r === 'string' && p.isAbsolute(r)) { const s = p.join(r, 'scripts', 'forward-hook.mjs'); process.argv = [process.argv[0], s, 'github-copilot']; await import((await import('node:url')).pathToFileURL(s).href); } } catch {}"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
],
|
|
101
|
+
"SessionEnd": [
|
|
102
|
+
{
|
|
103
|
+
"timeoutSec": 1,
|
|
104
|
+
"type": "command",
|
|
105
|
+
"exec": "node",
|
|
106
|
+
"args": [
|
|
107
|
+
"--input-type=module",
|
|
108
|
+
"-e",
|
|
109
|
+
"try { const p = await import('node:path'); const r = process.env.COPILOT_PLUGIN_ROOT; if (typeof r === 'string' && p.isAbsolute(r)) { const s = p.join(r, 'scripts', 'forward-hook.mjs'); process.argv = [process.argv[0], s, 'github-copilot']; await import((await import('node:url')).pathToFileURL(s).href); } } catch {}"
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
}
|