hanzi-browse 2.2.2 → 2.3.0
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/agent/loop.js +6 -2
- package/dist/cli/setup.js +10 -1
- package/dist/dashboard/assets/{index-C6ONL__u.js → index-dnFOSpJs.js} +13 -13
- package/dist/dashboard/index.html +1 -1
- package/dist/llm/client.d.ts +2 -0
- package/dist/llm/vertex.js +22 -6
- package/dist/managed/api.js +55 -4
- package/dist/managed/telemetry.js +4 -0
- package/dist/telemetry.js +0 -1
- package/package.json +1 -1
package/dist/agent/loop.js
CHANGED
|
@@ -70,8 +70,12 @@ export async function runAgentLoop(params) {
|
|
|
70
70
|
totalUsage.outputTokens += response.usage?.output_tokens || 0;
|
|
71
71
|
if (response.model)
|
|
72
72
|
lastModel = response.model;
|
|
73
|
-
// Add assistant response to conversation
|
|
74
|
-
|
|
73
|
+
// Add assistant response to conversation (preserve raw Gemini parts for thought signatures)
|
|
74
|
+
const assistantMsg = { role: "assistant", content: response.content };
|
|
75
|
+
if (response._rawGeminiParts) {
|
|
76
|
+
assistantMsg._rawGeminiParts = response._rawGeminiParts;
|
|
77
|
+
}
|
|
78
|
+
messages.push(assistantMsg);
|
|
75
79
|
// Extract text and tool calls
|
|
76
80
|
const textBlocks = response.content.filter((b) => b.type === "text");
|
|
77
81
|
const toolUseBlocks = response.content.filter((b) => b.type === "tool_use");
|
package/dist/cli/setup.js
CHANGED
|
@@ -14,6 +14,7 @@ import { randomUUID } from 'crypto';
|
|
|
14
14
|
import { isRelayRunning } from '../relay/auto-start.js';
|
|
15
15
|
import { WebSocketClient } from '../ipc/websocket-client.js';
|
|
16
16
|
import { detectCredentialSources as detectSources, checkCredentialFlowResult, } from './detect-credentials.js';
|
|
17
|
+
import { initTelemetry, trackEvent, shutdownTelemetry } from '../telemetry.js';
|
|
17
18
|
// ── Style ──────────────────────────────────────────────────────────────
|
|
18
19
|
const c = {
|
|
19
20
|
green: (s) => `\x1b[32m${s}\x1b[0m`,
|
|
@@ -695,6 +696,8 @@ async function installSkills(agents, isInteractive) {
|
|
|
695
696
|
}
|
|
696
697
|
// ── Main ───────────────────────────────────────────────────────────────
|
|
697
698
|
export async function runSetup(options = {}) {
|
|
699
|
+
initTelemetry();
|
|
700
|
+
trackEvent("setup_started");
|
|
698
701
|
const registry = getAgentRegistry();
|
|
699
702
|
const only = options.only;
|
|
700
703
|
const interactive = options.yes ? false : (process.stdin.isTTY ?? false);
|
|
@@ -746,8 +749,10 @@ export async function runSetup(options = {}) {
|
|
|
746
749
|
for (const agent of registry) {
|
|
747
750
|
if (only && agent.slug !== only)
|
|
748
751
|
continue;
|
|
749
|
-
if (agent.detect())
|
|
752
|
+
if (agent.detect()) {
|
|
750
753
|
detected.push(agent);
|
|
754
|
+
trackEvent("setup_agent_detected", { agent: agent.name });
|
|
755
|
+
}
|
|
751
756
|
}
|
|
752
757
|
sp1.stop(interactive
|
|
753
758
|
? `${c.green('✓')} Found ${c.bold(String(detected.length))} agent${detected.length === 1 ? '' : 's'} on this machine`
|
|
@@ -780,6 +785,8 @@ export async function runSetup(options = {}) {
|
|
|
780
785
|
else {
|
|
781
786
|
log(` ● No agents found. Add manually: ${JSON.stringify({ mcpServers: { "hanzi-browser": MCP_ENTRY } })}`);
|
|
782
787
|
}
|
|
788
|
+
trackEvent("setup_failed", { error_category: "no_agents_detected" });
|
|
789
|
+
await shutdownTelemetry();
|
|
783
790
|
return;
|
|
784
791
|
}
|
|
785
792
|
// ── Step 2: Configure agents ──
|
|
@@ -910,6 +917,8 @@ export async function runSetup(options = {}) {
|
|
|
910
917
|
log(` ${errors} agent(s) failed — check errors above.`);
|
|
911
918
|
log('');
|
|
912
919
|
}
|
|
920
|
+
trackEvent("setup_completed", { agent: detected.map(a => a.name).join(", ") });
|
|
921
|
+
await shutdownTelemetry();
|
|
913
922
|
rl?.close();
|
|
914
923
|
setTimeout(() => process.exit(0), 200);
|
|
915
924
|
}
|