@opencode-ai/sdk 0.0.0-snapshot-start-screen-tips-202512231927 → 0.0.0-snapshot-thinking-toggle-202512290017

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.
@@ -1015,6 +1015,10 @@ export type Config = {
1015
1015
  */
1016
1016
  theme?: string;
1017
1017
  keybinds?: KeybindsConfig;
1018
+ /**
1019
+ * Log level
1020
+ */
1021
+ logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR";
1018
1022
  /**
1019
1023
  * TUI specific settings
1020
1024
  */
package/dist/server.js CHANGED
@@ -5,7 +5,10 @@ export async function createOpencodeServer(options) {
5
5
  port: 4096,
6
6
  timeout: 5000,
7
7
  }, options ?? {});
8
- const proc = spawn(`opencode`, [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`], {
8
+ const args = [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`];
9
+ if (options.config?.logLevel)
10
+ args.push(`--log-level=${options.config.logLevel}`);
11
+ const proc = spawn(`opencode`, args, {
9
12
  signal: options.signal,
10
13
  env: {
11
14
  ...process.env,
@@ -396,6 +396,9 @@ export declare class Session extends HeyApiClient {
396
396
  [key: string]: boolean;
397
397
  };
398
398
  system?: string;
399
+ thinking?: {
400
+ effort: "default" | "medium" | "high";
401
+ };
399
402
  parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>;
400
403
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionPromptResponses, SessionPromptErrors, ThrowOnError, "fields">;
401
404
  /**
@@ -427,6 +430,9 @@ export declare class Session extends HeyApiClient {
427
430
  [key: string]: boolean;
428
431
  };
429
432
  system?: string;
433
+ thinking?: {
434
+ effort: "default" | "medium" | "high";
435
+ };
430
436
  parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>;
431
437
  }, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<SessionPromptAsyncResponses, SessionPromptAsyncErrors, ThrowOnError, "fields">;
432
438
  /**
@@ -737,6 +737,7 @@ export class Session extends HeyApiClient {
737
737
  { in: "body", key: "noReply" },
738
738
  { in: "body", key: "tools" },
739
739
  { in: "body", key: "system" },
740
+ { in: "body", key: "thinking" },
740
741
  { in: "body", key: "parts" },
741
742
  ],
742
743
  },
@@ -790,6 +791,7 @@ export class Session extends HeyApiClient {
790
791
  { in: "body", key: "noReply" },
791
792
  { in: "body", key: "tools" },
792
793
  { in: "body", key: "system" },
794
+ { in: "body", key: "thinking" },
793
795
  { in: "body", key: "parts" },
794
796
  ],
795
797
  },
@@ -79,6 +79,9 @@ export type UserMessage = {
79
79
  tools?: {
80
80
  [key: string]: boolean;
81
81
  };
82
+ thinking?: {
83
+ effort: "default" | "medium" | "high";
84
+ };
82
85
  };
83
86
  export type ProviderAuthError = {
84
87
  name: "ProviderAuthError";
@@ -115,6 +118,9 @@ export type ApiError = {
115
118
  [key: string]: string;
116
119
  };
117
120
  responseBody?: string;
121
+ metadata?: {
122
+ [key: string]: string;
123
+ };
118
124
  };
119
125
  };
120
126
  export type AssistantMessage = {
@@ -477,6 +483,36 @@ export type EventSessionCompacted = {
477
483
  sessionID: string;
478
484
  };
479
485
  };
486
+ export type EventTuiPromptAppend = {
487
+ type: "tui.prompt.append";
488
+ properties: {
489
+ text: string;
490
+ };
491
+ };
492
+ export type EventTuiCommandExecute = {
493
+ type: "tui.command.execute";
494
+ properties: {
495
+ command: "session.list" | "session.new" | "session.share" | "session.interrupt" | "session.compact" | "session.page.up" | "session.page.down" | "session.half.page.up" | "session.half.page.down" | "session.first" | "session.last" | "prompt.clear" | "prompt.submit" | "agent.cycle" | string;
496
+ };
497
+ };
498
+ export type EventTuiToastShow = {
499
+ type: "tui.toast.show";
500
+ properties: {
501
+ title?: string;
502
+ message: string;
503
+ variant: "info" | "success" | "warning" | "error";
504
+ /**
505
+ * Duration in milliseconds
506
+ */
507
+ duration?: number;
508
+ };
509
+ };
510
+ export type EventMcpToolsChanged = {
511
+ type: "mcp.tools.changed";
512
+ properties: {
513
+ server: string;
514
+ };
515
+ };
480
516
  export type EventCommandExecuted = {
481
517
  type: "command.executed";
482
518
  properties: {
@@ -560,30 +596,6 @@ export type EventVcsBranchUpdated = {
560
596
  branch?: string;
561
597
  };
562
598
  };
563
- export type EventTuiPromptAppend = {
564
- type: "tui.prompt.append";
565
- properties: {
566
- text: string;
567
- };
568
- };
569
- export type EventTuiCommandExecute = {
570
- type: "tui.command.execute";
571
- properties: {
572
- command: "session.list" | "session.new" | "session.share" | "session.interrupt" | "session.compact" | "session.page.up" | "session.page.down" | "session.half.page.up" | "session.half.page.down" | "session.first" | "session.last" | "prompt.clear" | "prompt.submit" | "agent.cycle" | string;
573
- };
574
- };
575
- export type EventTuiToastShow = {
576
- type: "tui.toast.show";
577
- properties: {
578
- title?: string;
579
- message: string;
580
- variant: "info" | "success" | "warning" | "error";
581
- /**
582
- * Duration in milliseconds
583
- */
584
- duration?: number;
585
- };
586
- };
587
599
  export type Pty = {
588
600
  id: string;
589
601
  title: string;
@@ -630,7 +642,7 @@ export type EventGlobalDisposed = {
630
642
  [key: string]: unknown;
631
643
  };
632
644
  };
633
- export type Event = EventInstallationUpdated | EventInstallationUpdateAvailable | EventProjectUpdated | EventServerInstanceDisposed | EventLspClientDiagnostics | EventLspUpdated | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventPermissionUpdated | EventPermissionReplied | EventFileEdited | EventTodoUpdated | EventSessionStatus | EventSessionIdle | EventSessionCompacted | EventCommandExecuted | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionDiff | EventSessionError | EventFileWatcherUpdated | EventVcsBranchUpdated | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventServerConnected | EventGlobalDisposed;
645
+ export type Event = EventInstallationUpdated | EventInstallationUpdateAvailable | EventProjectUpdated | EventServerInstanceDisposed | EventLspClientDiagnostics | EventLspUpdated | EventMessageUpdated | EventMessageRemoved | EventMessagePartUpdated | EventMessagePartRemoved | EventPermissionUpdated | EventPermissionReplied | EventFileEdited | EventTodoUpdated | EventSessionStatus | EventSessionIdle | EventSessionCompacted | EventTuiPromptAppend | EventTuiCommandExecute | EventTuiToastShow | EventMcpToolsChanged | EventCommandExecuted | EventSessionCreated | EventSessionUpdated | EventSessionDeleted | EventSessionDiff | EventSessionError | EventFileWatcherUpdated | EventVcsBranchUpdated | EventPtyCreated | EventPtyUpdated | EventPtyExited | EventPtyDeleted | EventServerConnected | EventGlobalDisposed;
634
646
  export type GlobalEvent = {
635
647
  directory: string;
636
648
  payload: Event;
@@ -816,6 +828,10 @@ export type KeybindsConfig = {
816
828
  * Previous agent
817
829
  */
818
830
  agent_cycle_reverse?: string;
831
+ /**
832
+ * Cycle thinking effort level
833
+ */
834
+ effort_cycle?: string;
819
835
  /**
820
836
  * Clear input field
821
837
  */
@@ -997,6 +1013,10 @@ export type KeybindsConfig = {
997
1013
  */
998
1014
  tips_toggle?: string;
999
1015
  };
1016
+ /**
1017
+ * Log level
1018
+ */
1019
+ export type LogLevel = "DEBUG" | "INFO" | "WARN" | "ERROR";
1000
1020
  export type AgentConfig = {
1001
1021
  model?: string;
1002
1022
  temperature?: number;
@@ -1198,6 +1218,7 @@ export type Config = {
1198
1218
  */
1199
1219
  theme?: string;
1200
1220
  keybinds?: KeybindsConfig;
1221
+ logLevel?: LogLevel;
1201
1222
  /**
1202
1223
  * TUI specific settings
1203
1224
  */
@@ -2515,6 +2536,9 @@ export type SessionPromptData = {
2515
2536
  [key: string]: boolean;
2516
2537
  };
2517
2538
  system?: string;
2539
+ thinking?: {
2540
+ effort: "default" | "medium" | "high";
2541
+ };
2518
2542
  parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>;
2519
2543
  };
2520
2544
  path: {
@@ -2678,6 +2702,9 @@ export type SessionPromptAsyncData = {
2678
2702
  [key: string]: boolean;
2679
2703
  };
2680
2704
  system?: string;
2705
+ thinking?: {
2706
+ effort: "default" | "medium" | "high";
2707
+ };
2681
2708
  parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>;
2682
2709
  };
2683
2710
  path: {
package/dist/v2/server.js CHANGED
@@ -5,7 +5,10 @@ export async function createOpencodeServer(options) {
5
5
  port: 4096,
6
6
  timeout: 5000,
7
7
  }, options ?? {});
8
- const proc = spawn(`opencode`, [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`], {
8
+ const args = [`serve`, `--hostname=${options.hostname}`, `--port=${options.port}`];
9
+ if (options.config?.logLevel)
10
+ args.push(`--log-level=${options.config.logLevel}`);
11
+ const proc = spawn(`opencode`, args, {
9
12
  signal: options.signal,
10
13
  env: {
11
14
  ...process.env,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/sdk",
4
- "version": "0.0.0-snapshot-start-screen-tips-202512231927",
4
+ "version": "0.0.0-snapshot-thinking-toggle-202512290017",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "typecheck": "tsgo --noEmit",