happy-imou-cloud 2.1.1 → 2.1.3
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/bin/happy-cloud.mjs +21 -21
- package/compat/acp-sdk-schema/index.js +27 -27
- package/compat/acp-sdk-schema/types.gen.js +2 -2
- package/compat/acp-sdk-schema/zod.gen.js +1553 -1553
- package/compat/ink-build/components/Cursor.d.ts +83 -83
- package/compat/ink-build/components/Cursor.js +52 -52
- package/compat/ink-build/components/CursorContext.d.ts +11 -11
- package/compat/ink-build/components/CursorContext.js +7 -7
- package/compat/ink-build/components/ErrorBoundary.d.ts +18 -18
- package/compat/ink-build/components/ErrorBoundary.js +22 -22
- package/compat/ink-build/hooks/use-cursor.d.ts +12 -12
- package/compat/ink-build/hooks/use-cursor.js +28 -28
- package/dist/{BaseReasoningProcessor-CBMK-8Gi.cjs → BaseReasoningProcessor-BrcBFCoL.cjs} +3 -3
- package/dist/{BaseReasoningProcessor-Dn9FxfxU.mjs → BaseReasoningProcessor-CPLK0a8y.mjs} +3 -3
- package/dist/ProviderSelectionHandler-CrXfMTg1.mjs +261 -0
- package/dist/ProviderSelectionHandler-f7_I3vQa.cjs +265 -0
- package/dist/{api-DBy5lPZw.mjs → api-BGv79x9Q.mjs} +3 -3
- package/dist/{api-DId_j3C2.cjs → api-OoiG7XjD.cjs} +2 -2
- package/dist/{command-DwfUpmId.cjs → command-DAYJSP16.cjs} +3 -3
- package/dist/{command-CeaBwYCW.mjs → command-FbV44egL.mjs} +3 -3
- package/dist/{index-CuuYSKiv.cjs → index-D9lWHpn-.cjs} +199 -78
- package/dist/{index-66vjECEd.mjs → index-TRC83Ks9.mjs} +196 -75
- package/dist/index.cjs +3 -3
- package/dist/index.mjs +3 -3
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.cts +51 -52
- package/dist/lib.d.mts +51 -52
- package/dist/lib.mjs +1 -1
- package/dist/{persistence-BOWh1NER.mjs → persistence-Cmgj3ubQ.mjs} +1 -1
- package/dist/{persistence-Dzr6sFwD.cjs → persistence-lN9HV4IZ.cjs} +1 -1
- package/dist/{registerKillSessionHandler-D4_wpN18.mjs → registerKillSessionHandler-NZd3xieQ.mjs} +417 -5
- package/dist/{registerKillSessionHandler-Dg_iRBPm.cjs → registerKillSessionHandler-pk4Ohq4Y.cjs} +419 -4
- package/dist/{runClaude-B74dHAnQ.mjs → runClaude-7St9-Jci.mjs} +34 -5
- package/dist/{runClaude-oIFzkfuU.cjs → runClaude-BP-O6ucu.cjs} +37 -8
- package/dist/{runCodex-D_9CuL6M.cjs → runCodex-BV6kKtTO.cjs} +29 -21
- package/dist/{runCodex-mLHjsgVj.mjs → runCodex-BaXi_9BC.mjs} +26 -18
- package/dist/{runGemini-CcWGezMt.cjs → runGemini-BiYKqJqO.cjs} +267 -82
- package/dist/{runGemini-BMiho2ab.mjs → runGemini-ClNqE9N3.mjs} +267 -82
- package/package.json +9 -9
- package/scripts/build.mjs +68 -68
- package/scripts/devtools/README.md +9 -9
- package/scripts/e2e/fake-codex-acp-agent.mjs +139 -139
- package/scripts/e2e/local-server-session-roundtrip.mjs +1063 -1063
- package/scripts/ensureAcpSdkCompat.mjs +171 -173
- package/scripts/release-smoke.mjs +38 -35
- package/dist/ProviderSelectionHandler-BuXk-8ji.cjs +0 -680
- package/dist/ProviderSelectionHandler-CMaQThYO.mjs +0 -673
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# CLI Devtools
|
|
2
|
-
|
|
3
|
-
这组脚本用于 CLI 本地开发辅助。
|
|
4
|
-
|
|
5
|
-
当前包含:
|
|
6
|
-
|
|
7
|
-
- mock credentials 生成器
|
|
8
|
-
|
|
9
|
-
新增 CLI 专属开发脚本应优先放在这里。
|
|
1
|
+
# CLI Devtools
|
|
2
|
+
|
|
3
|
+
这组脚本用于 CLI 本地开发辅助。
|
|
4
|
+
|
|
5
|
+
当前包含:
|
|
6
|
+
|
|
7
|
+
- mock credentials 生成器
|
|
8
|
+
|
|
9
|
+
新增 CLI 专属开发脚本应优先放在这里。
|
|
@@ -1,139 +1,139 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { appendFileSync } from 'node:fs';
|
|
4
|
-
|
|
5
|
-
const decoder = new TextDecoder();
|
|
6
|
-
let buffer = '';
|
|
7
|
-
let sessionId = 'fake-codex-session';
|
|
8
|
-
const logPath = process.env.HAPPY_E2E_FAKE_ACP_LOG || '';
|
|
9
|
-
|
|
10
|
-
function send(payload) {
|
|
11
|
-
process.stdout.write(`${JSON.stringify(payload)}\n`);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function trace(message) {
|
|
15
|
-
if (!logPath) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
appendFileSync(logPath, `${message}\n`, 'utf8');
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
function ok(id, result) {
|
|
23
|
-
send({
|
|
24
|
-
jsonrpc: '2.0',
|
|
25
|
-
id,
|
|
26
|
-
result,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function parsePromptText(params) {
|
|
31
|
-
const blocks = Array.isArray(params?.prompt) ? params.prompt : [];
|
|
32
|
-
return blocks
|
|
33
|
-
.map((block) => (block && typeof block === 'object' && typeof block.text === 'string' ? block.text : ''))
|
|
34
|
-
.filter(Boolean)
|
|
35
|
-
.join('\n');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function emitPromptResponse(promptText) {
|
|
39
|
-
const replyPrefix = process.env.HAPPY_E2E_FAKE_ACP_RESPONSE || 'LOCAL_E2E_ACK';
|
|
40
|
-
const replyText = `${replyPrefix}: ${promptText}`.trim();
|
|
41
|
-
trace(`prompt=${JSON.stringify(promptText)}`);
|
|
42
|
-
trace(`reply=${JSON.stringify(replyText)}`);
|
|
43
|
-
|
|
44
|
-
setTimeout(() => {
|
|
45
|
-
send({
|
|
46
|
-
jsonrpc: '2.0',
|
|
47
|
-
method: 'session/update',
|
|
48
|
-
params: {
|
|
49
|
-
sessionId,
|
|
50
|
-
update: {
|
|
51
|
-
sessionUpdate: 'agent_message_chunk',
|
|
52
|
-
content: {
|
|
53
|
-
type: 'text',
|
|
54
|
-
text: replyText,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
send({
|
|
61
|
-
jsonrpc: '2.0',
|
|
62
|
-
method: 'session/update',
|
|
63
|
-
params: {
|
|
64
|
-
sessionId,
|
|
65
|
-
update: {
|
|
66
|
-
sessionUpdate: 'task_complete',
|
|
67
|
-
usage: {
|
|
68
|
-
input_tokens: Math.max(1, promptText.length),
|
|
69
|
-
output_tokens: Math.max(1, replyText.length),
|
|
70
|
-
total_tokens: Math.max(2, promptText.length + replyText.length),
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
}, 50);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
process.stdin.on('data', (chunk) => {
|
|
79
|
-
buffer += decoder.decode(chunk, { stream: true });
|
|
80
|
-
const lines = buffer.split('\n');
|
|
81
|
-
buffer = lines.pop() || '';
|
|
82
|
-
|
|
83
|
-
for (const line of lines) {
|
|
84
|
-
const trimmed = line.trim();
|
|
85
|
-
if (!trimmed) {
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
let request;
|
|
90
|
-
try {
|
|
91
|
-
request = JSON.parse(trimmed);
|
|
92
|
-
} catch {
|
|
93
|
-
continue;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const id = request?.id;
|
|
97
|
-
const method = request?.method;
|
|
98
|
-
|
|
99
|
-
if (typeof method !== 'string' || id === undefined || id === null) {
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
trace(`method=${method}`);
|
|
104
|
-
|
|
105
|
-
if (method === 'initialize') {
|
|
106
|
-
ok(id, {
|
|
107
|
-
protocolVersion: 1,
|
|
108
|
-
authMethods: [],
|
|
109
|
-
});
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (method === 'session/new') {
|
|
114
|
-
sessionId = request?.params?.cwd
|
|
115
|
-
? `fake-codex-session:${request.params.cwd}`
|
|
116
|
-
: 'fake-codex-session';
|
|
117
|
-
ok(id, { sessionId });
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (method === 'session/prompt') {
|
|
122
|
-
ok(id, {});
|
|
123
|
-
emitPromptResponse(parsePromptText(request?.params));
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
if (method === 'session/cancel') {
|
|
128
|
-
ok(id, {});
|
|
129
|
-
continue;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
ok(id, {});
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
process.stdin.on('end', () => {
|
|
137
|
-
trace('stdin=end');
|
|
138
|
-
process.exit(0);
|
|
139
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { appendFileSync } from 'node:fs';
|
|
4
|
+
|
|
5
|
+
const decoder = new TextDecoder();
|
|
6
|
+
let buffer = '';
|
|
7
|
+
let sessionId = 'fake-codex-session';
|
|
8
|
+
const logPath = process.env.HAPPY_E2E_FAKE_ACP_LOG || '';
|
|
9
|
+
|
|
10
|
+
function send(payload) {
|
|
11
|
+
process.stdout.write(`${JSON.stringify(payload)}\n`);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function trace(message) {
|
|
15
|
+
if (!logPath) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
appendFileSync(logPath, `${message}\n`, 'utf8');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function ok(id, result) {
|
|
23
|
+
send({
|
|
24
|
+
jsonrpc: '2.0',
|
|
25
|
+
id,
|
|
26
|
+
result,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function parsePromptText(params) {
|
|
31
|
+
const blocks = Array.isArray(params?.prompt) ? params.prompt : [];
|
|
32
|
+
return blocks
|
|
33
|
+
.map((block) => (block && typeof block === 'object' && typeof block.text === 'string' ? block.text : ''))
|
|
34
|
+
.filter(Boolean)
|
|
35
|
+
.join('\n');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function emitPromptResponse(promptText) {
|
|
39
|
+
const replyPrefix = process.env.HAPPY_E2E_FAKE_ACP_RESPONSE || 'LOCAL_E2E_ACK';
|
|
40
|
+
const replyText = `${replyPrefix}: ${promptText}`.trim();
|
|
41
|
+
trace(`prompt=${JSON.stringify(promptText)}`);
|
|
42
|
+
trace(`reply=${JSON.stringify(replyText)}`);
|
|
43
|
+
|
|
44
|
+
setTimeout(() => {
|
|
45
|
+
send({
|
|
46
|
+
jsonrpc: '2.0',
|
|
47
|
+
method: 'session/update',
|
|
48
|
+
params: {
|
|
49
|
+
sessionId,
|
|
50
|
+
update: {
|
|
51
|
+
sessionUpdate: 'agent_message_chunk',
|
|
52
|
+
content: {
|
|
53
|
+
type: 'text',
|
|
54
|
+
text: replyText,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
send({
|
|
61
|
+
jsonrpc: '2.0',
|
|
62
|
+
method: 'session/update',
|
|
63
|
+
params: {
|
|
64
|
+
sessionId,
|
|
65
|
+
update: {
|
|
66
|
+
sessionUpdate: 'task_complete',
|
|
67
|
+
usage: {
|
|
68
|
+
input_tokens: Math.max(1, promptText.length),
|
|
69
|
+
output_tokens: Math.max(1, replyText.length),
|
|
70
|
+
total_tokens: Math.max(2, promptText.length + replyText.length),
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}, 50);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
process.stdin.on('data', (chunk) => {
|
|
79
|
+
buffer += decoder.decode(chunk, { stream: true });
|
|
80
|
+
const lines = buffer.split('\n');
|
|
81
|
+
buffer = lines.pop() || '';
|
|
82
|
+
|
|
83
|
+
for (const line of lines) {
|
|
84
|
+
const trimmed = line.trim();
|
|
85
|
+
if (!trimmed) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
let request;
|
|
90
|
+
try {
|
|
91
|
+
request = JSON.parse(trimmed);
|
|
92
|
+
} catch {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const id = request?.id;
|
|
97
|
+
const method = request?.method;
|
|
98
|
+
|
|
99
|
+
if (typeof method !== 'string' || id === undefined || id === null) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
trace(`method=${method}`);
|
|
104
|
+
|
|
105
|
+
if (method === 'initialize') {
|
|
106
|
+
ok(id, {
|
|
107
|
+
protocolVersion: 1,
|
|
108
|
+
authMethods: [],
|
|
109
|
+
});
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (method === 'session/new') {
|
|
114
|
+
sessionId = request?.params?.cwd
|
|
115
|
+
? `fake-codex-session:${request.params.cwd}`
|
|
116
|
+
: 'fake-codex-session';
|
|
117
|
+
ok(id, { sessionId });
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (method === 'session/prompt') {
|
|
122
|
+
ok(id, {});
|
|
123
|
+
emitPromptResponse(parsePromptText(request?.params));
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (method === 'session/cancel') {
|
|
128
|
+
ok(id, {});
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
ok(id, {});
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
process.stdin.on('end', () => {
|
|
137
|
+
trace('stdin=end');
|
|
138
|
+
process.exit(0);
|
|
139
|
+
});
|