@av-pi-studio/client 0.0.98 → 0.0.100

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.
@@ -1,4 +1,4 @@
1
- import type { AgentCloneResponse, AgentCompactResponse, AgentCycleModelResponse, AgentExportHtmlResponse, AgentForkMessagesResponse, AgentForkResponse, AgentLastAssistantTextResponse, AgentListCommandsResponse, AgentNewSessionResponse, AgentSessionStatsResponse, AgentSetModelResponse, AgentSetSessionNameResponse, AgentStreamEvent, AgentSwitchSessionResponse, AgentUiPendingRequest, AgentUiRequest, AgentUiResolved, AgentUiResponse, AgentUiSurface, CreateAgentRequest, ExtensionPacksListResponse, ExtensionPacksSetResponse, FetchAgentTimelineResponse, ProviderAuthInfo, ProviderAuthType, SessionMessage, TimelineDirection } from "@av-pi-studio/protocol";
1
+ import type { AgentCloneResponse, AgentCompactResponse, AgentCycleModelResponse, AgentExportHtmlResponse, AgentForkMessagesResponse, AgentForkResponse, AgentLastAssistantTextResponse, AgentListCommandsResponse, AgentNewSessionResponse, AgentSessionStatsResponse, AgentSetModelResponse, AgentSetSessionNameResponse, AgentSetThinkingResponse, AgentStreamEvent, AgentSwitchSessionResponse, AgentThinkingLevelsResponse, AgentUiPendingRequest, AgentUiRequest, AgentUiResolved, AgentUiResponse, AgentUiSurface, CreateAgentRequest, ExtensionPacksListResponse, ExtensionPacksSetResponse, FetchAgentTimelineResponse, ProviderAuthInfo, ProviderAuthType, SessionMessage, TimelineDirection } from "@av-pi-studio/protocol";
2
2
  import type { DaemonClient } from "./daemon-client.js";
3
3
  /**
4
4
  * High-level `PiStudioClient` SDK facade over the low-level `DaemonClient` driver.
@@ -32,6 +32,8 @@ export interface AgentUpdateMessage {
32
32
  status?: string;
33
33
  title?: string;
34
34
  labels?: Record<string, string>;
35
+ /** Effective thinking level (sprint-070) — present on set/model-change/update broadcasts. */
36
+ thinkingLevel?: string;
35
37
  [key: string]: unknown;
36
38
  }
37
39
  /** Shape of an inbound `workspace_update` session message. */
@@ -119,6 +121,10 @@ export interface PiStudioAgentActions {
119
121
  lastAssistantText(): Promise<AgentLastAssistantTextResponse["payload"]>;
120
122
  /** List the session's discoverable commands (extensions, prompt templates, skills). */
121
123
  listCommands(): Promise<AgentListCommandsResponse["payload"]>;
124
+ /** Set the thinking level; response `level` is the effective value after provider clamping. */
125
+ setThinking(level: string): Promise<AgentSetThinkingResponse["payload"]>;
126
+ /** Available thinking levels for the session's current model. */
127
+ listThinkingLevels(): Promise<AgentThinkingLevelsResponse["payload"]>;
122
128
  }
123
129
  export interface PiStudioWorkspaceActions {
124
130
  readonly workspaceId: string;
@@ -136,6 +142,14 @@ export interface ProviderModel {
136
142
  * (`"pi"`/`"mock"`) used only to pick which client answered this list.
137
143
  */
138
144
  provider?: string;
145
+ /** Whether the model supports reasoning (Pi `Model.reasoning`; sprint-070). Absent ⇒
146
+ * non-reasoning. Lets a draft's thinking selector offer the right levels with no live
147
+ * session. */
148
+ reasoning?: boolean;
149
+ /** The thinking levels the model supports (derived from Pi's `thinkingLevelMap`; `["off"]`
150
+ * for non-reasoning models; sprint-070). Absent ⇒ unknown — fall back to the full ladder and
151
+ * let Pi clamp at apply time. */
152
+ thinkingLevels?: string[];
139
153
  }
140
154
  export interface ListProviderModelsResponse {
141
155
  type: "list_provider_models_response";
@@ -151,6 +165,9 @@ export interface ResolveDefaultModelResponse {
151
165
  * else the provider's built-in default — or `undefined` if the provider can't resolve one
152
166
  * without spawning a session. Display-only: never itself sent back to the daemon as a pick. */
153
167
  model?: string;
168
+ /** The fresh default thinking level Pi would start a new session at (sprint-070), when the
169
+ * provider reports one. */
170
+ thinkingLevel?: string;
154
171
  /** The resolved model's own underlying LLM provider (e.g. `"anthropic"`) — same distinction as
155
172
  * `ProviderModel.provider`, required to pin it via `config.modelProvider` if the draft
156
173
  * materializes without the user ever changing it. */
@@ -561,6 +561,15 @@ class AgentHandle {
561
561
  listCommands() {
562
562
  return this.daemon.request("agent_list_commands_request", { agentId: this.agentId });
563
563
  }
564
+ setThinking(level) {
565
+ return this.daemon.request("agent_set_thinking_request", {
566
+ agentId: this.agentId,
567
+ level,
568
+ });
569
+ }
570
+ listThinkingLevels() {
571
+ return this.daemon.request("agent_thinking_levels_request", { agentId: this.agentId });
572
+ }
564
573
  }
565
574
  class WorkspaceHandle {
566
575
  daemon;
@@ -133,6 +133,25 @@ export function makeScriptedDaemon(opts) {
133
133
  });
134
134
  return;
135
135
  }
136
+ case "agent_set_thinking_request": {
137
+ // Mirrors the daemon's effective-level semantics (sprint-070): the scripted fake
138
+ // "clamps" every request down to `medium` so client tests can assert they read the
139
+ // response, not their own request.
140
+ reply({
141
+ type: "agent_set_thinking_response",
142
+ requestId,
143
+ payload: { agentId: msg.agentId, level: "medium" },
144
+ });
145
+ return;
146
+ }
147
+ case "agent_thinking_levels_request": {
148
+ reply({
149
+ type: "agent_thinking_levels_response",
150
+ requestId,
151
+ payload: { agentId: msg.agentId, levels: ["off", "low", "medium", "high"] },
152
+ });
153
+ return;
154
+ }
136
155
  case "list_provider_models": {
137
156
  reply({
138
157
  type: "list_provider_models_response",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@av-pi-studio/client",
3
- "version": "0.0.98",
3
+ "version": "0.0.100",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.map",
@@ -20,7 +20,7 @@
20
20
  "clean": "rm -rf dist *.tsbuildinfo"
21
21
  },
22
22
  "dependencies": {
23
- "@av-pi-studio/protocol": "^0.0.98",
24
- "@av-pi-studio/relay": "^0.0.98"
23
+ "@av-pi-studio/protocol": "^0.0.100",
24
+ "@av-pi-studio/relay": "^0.0.100"
25
25
  }
26
26
  }