@ouro.bot/cli 0.1.0-alpha.359 → 0.1.0-alpha.360

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.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.360",
6
+ "changes": [
7
+ "Each provider runtime now owns its `ping()` method, replacing the centralized if/else routing chain. Azure ping switched from chat completions to Responses API to match its runtime. Prevents the entire class of ping/runtime API drift bugs."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.359",
6
12
  "changes": [
@@ -48,16 +54,16 @@
48
54
  "version": "0.1.0-alpha.352",
49
55
  "changes": [
50
56
  "Settle tool description now communicates turn-ending semantics: 'deliver your response and end your turn' with explicit guidance against settling with status updates mid-task.",
51
- "Observe tool now available in all outward channels including 1:1 chats, not just groups and reactions agents can absorb messages without responding when the moment doesn't call for words.",
57
+ "Observe tool now available in all outward channels including 1:1 chats, not just groups and reactions \u2014 agents can absorb messages without responding when the moment doesn't call for words.",
52
58
  "Autonomous execution prompt contract added: when told to work autonomously, agents use ponder to absorb new messages and continue using tools, settling only with the final result."
53
59
  ]
54
60
  },
55
61
  {
56
62
  "version": "0.1.0-alpha.351",
57
63
  "changes": [
58
- "Surface tool description rewritten from 'surface progress' to 'send a message to someone' makes it clear the tool is for interpersonal messaging, not status reporting.",
64
+ "Surface tool description rewritten from 'surface progress' to 'send a message to someone' \u2014 makes it clear the tool is for interpersonal messaging, not status reporting.",
59
65
  "Inner dialog prompt contract now guides agents to use rest(note) for heartbeat state and ponder(reflection) for deeper thoughts, keeping surface strictly for words meant for another person.",
60
- "Removed [surfaced from inner dialog] prefix from synthetic session messages provenance is tracked via captureKind: 'synthetic', the prefix was redundant and created echo loops.",
66
+ "Removed [surfaced from inner dialog] prefix from synthetic session messages \u2014 provenance is tracked via captureKind: 'synthetic', the prefix was redundant and created echo loops.",
61
67
  "Obligation summaries and attention queue headers reframed as structured internal data ([internal] tags) instead of surface-ready prose.",
62
68
  "Shared proactive-content-guard module blocks internal content (heartbeat, check-in, task board, obligation status, meta markers) from BlueBubbles and Teams proactive sends."
63
69
  ]
@@ -19,17 +19,7 @@ const PING_TIMEOUT_MS = 10_000;
19
19
  const PING_PROMPT = "ping";
20
20
  const CHAT_PING_MAX_TOKENS = 1;
21
21
  const RESPONSE_PING_MAX_OUTPUT_TOKENS = 16;
22
- const ANTHROPIC_SETUP_PING_MODEL = "claude-haiku-4-5-20251001";
23
22
  const DEFAULT_AZURE_API_VERSION = "2025-04-01-preview";
24
- const PING_CALLBACKS = {
25
- onModelStart() { },
26
- onModelStreamStart() { },
27
- onTextChunk() { },
28
- onReasoningChunk() { },
29
- onToolStart() { },
30
- onToolEnd() { },
31
- onError() { },
32
- };
33
23
  function createPingMessages() {
34
24
  return [{ role: "user", content: PING_PROMPT }];
35
25
  }
@@ -195,34 +185,7 @@ async function pingProvider(provider, config, options = {}) {
195
185
  /* v8 ignore next -- timeout callback: only fires after 10s, tests resolve faster @preserve */
196
186
  const timeout = setTimeout(() => controller.abort(), PING_TIMEOUT_MS);
197
187
  try {
198
- // Minimal API call — no thinking, no reasoning, no tools.
199
- if (provider === "anthropic") {
200
- // Use haiku for the ping — setup tokens may not have access to newer
201
- // models, but if haiku works, the credentials are valid.
202
- // Override the beta header to exclude thinking (which requires a
203
- // thinking param in the request body).
204
- const client = runtime.client;
205
- await client.messages.create(createChatPingRequest(ANTHROPIC_SETUP_PING_MODEL), { signal: controller.signal, headers: { "anthropic-beta": "claude-code-20250219,oauth-2025-04-20" } });
206
- }
207
- else if (provider === "openai-codex") {
208
- await runtime.streamTurn({
209
- messages: createPingMessages(),
210
- activeTools: [],
211
- callbacks: PING_CALLBACKS,
212
- signal: controller.signal,
213
- toolChoiceRequired: false,
214
- });
215
- }
216
- else if (provider === "github-copilot" && !runtime.model.startsWith("claude")) {
217
- // GPT models on Copilot use the Responses API
218
- const client = runtime.client;
219
- await client.responses.create(createResponsePingRequest(runtime.model), { signal: controller.signal });
220
- }
221
- else {
222
- // OpenAI-compatible providers (azure, minimax, github-copilot claude)
223
- const client = runtime.client;
224
- await client.chat.completions.create(createChatPingRequest(runtime.model), { signal: controller.signal });
225
- }
188
+ await runtime.ping(controller.signal);
226
189
  }
227
190
  finally {
228
191
  clearTimeout(timeout);
@@ -459,6 +459,12 @@ function createAnthropicProviderRuntime(model, anthropicConfig = (0, config_1.ge
459
459
  const freshClient = await ensureClient();
460
460
  return streamAnthropicMessages(freshClient, model, request);
461
461
  },
462
+ /* v8 ignore start -- ping: tested via provider-ping.test.ts @preserve */
463
+ async ping(signal) {
464
+ const freshClient = await ensureClient();
465
+ await freshClient.messages.create({ model: "claude-haiku-4-5-20251001", max_tokens: 1, messages: [{ role: "user", content: "ping" }] }, { signal, headers: { "anthropic-beta": "claude-code-20250219,oauth-2025-04-20" } });
466
+ },
467
+ /* v8 ignore stop */
462
468
  /* v8 ignore next 3 -- delegation: classification logic tested via classifyAnthropicError @preserve */
463
469
  classifyError(error) {
464
470
  return classifyAnthropicError(error);
@@ -144,6 +144,11 @@ function createAzureProviderRuntime(model, azureConfig = (0, config_1.getAzureCo
144
144
  nativeInput.push(item);
145
145
  return result;
146
146
  },
147
+ /* v8 ignore start -- ping: tested via provider-ping.test.ts @preserve */
148
+ async ping(signal) {
149
+ await this.client.responses.create({ model: this.model, input: "ping", max_output_tokens: 16 }, { signal });
150
+ },
151
+ /* v8 ignore stop */
147
152
  /* v8 ignore next 3 -- delegation: classification logic tested via classifyAzureError @preserve */
148
153
  classifyError(error) {
149
154
  return classifyAzureError(error);
@@ -73,6 +73,11 @@ function createGithubCopilotProviderRuntime(model, config = (0, config_1.getGith
73
73
  }
74
74
  },
75
75
  /* v8 ignore stop */
76
+ /* v8 ignore start -- ping: tested via provider-ping.test.ts @preserve */
77
+ async ping(signal) {
78
+ await this.client.chat.completions.create({ model: this.model, max_tokens: 1, messages: [{ role: "user", content: "ping" }] }, { signal });
79
+ },
80
+ /* v8 ignore stop */
76
81
  /* v8 ignore next 3 -- delegation: classification logic tested via classifyGithubCopilotError @preserve */
77
82
  classifyError(error) {
78
83
  return classifyGithubCopilotError(error);
@@ -127,6 +132,11 @@ function createGithubCopilotProviderRuntime(model, config = (0, config_1.getGith
127
132
  }
128
133
  },
129
134
  /* v8 ignore stop */
135
+ /* v8 ignore start -- ping: tested via provider-ping.test.ts @preserve */
136
+ async ping(signal) {
137
+ await this.client.responses.create({ model: this.model, input: "ping", max_output_tokens: 16 }, { signal });
138
+ },
139
+ /* v8 ignore stop */
130
140
  /* v8 ignore next 3 -- delegation: classification logic tested via classifyGithubCopilotError @preserve */
131
141
  classifyError(error) {
132
142
  return classifyGithubCopilotError(error);
@@ -63,6 +63,11 @@ function createMinimaxProviderRuntime(model, minimaxConfig = (0, config_1.getMin
63
63
  params.tool_choice = "required";
64
64
  return (0, streaming_1.streamChatCompletion)(this.client, params, request.callbacks, request.signal, request.eagerSettleStreaming);
65
65
  },
66
+ /* v8 ignore start -- ping: tested via provider-ping.test.ts @preserve */
67
+ async ping(signal) {
68
+ await this.client.chat.completions.create({ model: this.model, max_tokens: 1, messages: [{ role: "user", content: "ping" }] }, { signal });
69
+ },
70
+ /* v8 ignore stop */
66
71
  classifyError(error) {
67
72
  return classifyMinimaxError(error);
68
73
  },
@@ -164,6 +164,11 @@ function createOpenAICodexProviderRuntime(model, codexConfig = (0, config_1.getO
164
164
  throw error instanceof Error ? error : new Error(String(error));
165
165
  }
166
166
  },
167
+ /* v8 ignore start -- ping: tested via provider-ping.test.ts @preserve */
168
+ async ping(signal) {
169
+ await this.client.responses.create({ model: this.model, input: "ping", max_output_tokens: 16 }, { signal });
170
+ },
171
+ /* v8 ignore stop */
167
172
  /* v8 ignore next 3 -- delegation: classification logic tested via classifyOpenAICodexError @preserve */
168
173
  classifyError(error) {
169
174
  return classifyOpenAICodexError(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.359",
3
+ "version": "0.1.0-alpha.360",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",