theokit 0.10.0 → 0.11.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.
@@ -68,9 +68,27 @@ interface AgentErrorEvent {
68
68
  retryAfterMs?: number;
69
69
  }
70
70
  /**
71
- * Runtime AgentEvent discriminated union of the 4 variants emitted by
71
+ * Extended thinking / reasoning event.
72
+ *
73
+ * Carries the model's reasoning text (when the model supports extended
74
+ * thinking). Mirrors the `@theokit/agents` stream-layer `ThinkingEvent`
75
+ * (`packages/agents/src/bridge/agent-stream-events.ts`) so the two layers
76
+ * agree on the wire form; defined here (not imported) to keep `core/contracts`
77
+ * free of a dependency on `@theokit/agents` (G1 dependency direction).
78
+ *
79
+ * Consumers that switch only on the other variants are unaffected (additive);
80
+ * a consumer that wants to surface reasoning opts in by handling `'thinking'`.
81
+ */
82
+ interface AgentThinkingEvent {
83
+ type: 'thinking';
84
+ content: string;
85
+ /** Optional id for client-side dedup / animation keys. */
86
+ id?: string;
87
+ }
88
+ /**
89
+ * Runtime AgentEvent — discriminated union of the 5 variants emitted by
72
90
  * agent endpoints. Server produces; client consumes.
73
91
  */
74
- type AgentEvent = AgentMessageEvent | AgentToolCallEvent | AgentToolResultEvent | AgentErrorEvent;
92
+ type AgentEvent = AgentMessageEvent | AgentToolCallEvent | AgentToolResultEvent | AgentErrorEvent | AgentThinkingEvent;
75
93
 
76
- export type { AgentEvent as A, AgentErrorEvent as a, AgentMessageEvent as b, AgentToolCallEvent as c, AgentToolResultEvent as d, AgentRunErrorCode as e };
94
+ export type { AgentEvent as A, AgentErrorEvent as a, AgentMessageEvent as b, AgentThinkingEvent as c, AgentToolCallEvent as d, AgentToolResultEvent as e, AgentRunErrorCode as f };
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  import { T as TheoErrorEnvelope } from '../error-envelope-BsNzzAV5.js';
3
3
  export { FetchOptionsLike, Fetcher, QueryKey, UseTheoQueryConfig, buildUseTheoQueryConfig, stableQueryKey } from '../react-query/index.js';
4
- import { A as AgentEvent, a as AgentErrorEvent } from '../agent-events-B3KNV9ER.js';
5
- export { b as AgentMessageEvent, c as AgentToolCallEvent, d as AgentToolResultEvent } from '../agent-events-B3KNV9ER.js';
4
+ import { A as AgentEvent, a as AgentErrorEvent } from '../agent-events-DosDXkSV.js';
5
+ export { b as AgentMessageEvent, c as AgentThinkingEvent, d as AgentToolCallEvent, e as AgentToolResultEvent } from '../agent-events-DosDXkSV.js';
6
6
  import * as react from 'react';
7
7
  import { LinkProps as LinkProps$1 } from 'react-router';
8
8
 
@@ -1,5 +1,5 @@
1
- import { a as AgentErrorEvent, A as AgentEvent } from '../../agent-events-B3KNV9ER.js';
2
- export { b as AgentMessageEvent, e as AgentRunErrorCode, c as AgentToolCallEvent, d as AgentToolResultEvent } from '../../agent-events-B3KNV9ER.js';
1
+ import { a as AgentErrorEvent, A as AgentEvent } from '../../agent-events-DosDXkSV.js';
2
+ export { b as AgentMessageEvent, f as AgentRunErrorCode, c as AgentThinkingEvent, d as AgentToolCallEvent, e as AgentToolResultEvent } from '../../agent-events-DosDXkSV.js';
3
3
 
4
4
  /**
5
5
  * Item #4 — `streamAgentRun`
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { A as AgentEvent } from '../../agent-events-B3KNV9ER.js';
2
+ import { A as AgentEvent } from '../../agent-events-DosDXkSV.js';
3
3
  import { b as WebSocketLike } from '../../define-websocket-CdK94O-D.js';
4
4
  export { W as WebSocketHandler, a as WebSocketHandlerWeb, d as defineWebSocket, c as defineWebSocketWeb } from '../../define-websocket-CdK94O-D.js';
5
5
  import { IncomingMessage } from 'node:http';
@@ -7,7 +7,7 @@ export { ActionNode, ActionScanError, LoadedManifest, ManifestAction, ManifestRo
7
7
  export { L as LoadModule, S as ServerRouteNode, c as compilePattern, a as createProductionLoader, b as createViteLoader, m as matchRoute } from '../match-CfbEFRG4.js';
8
8
  import { T as TheoErrorEnvelope, a as TheoErrorCode, V as ValidationFieldsExt } from '../error-envelope-BsNzzAV5.js';
9
9
  export { AgentRunLike, AgentRunResult, AgentRunStreamMessage, ConversationHistoryArgs, ConversationHistoryResult, ConversationStorageLike, SdkAgent, SdkAgentOptions, SdkRunLike, createConversationHistory, errorToEvent, streamAgentRun } from './agent/index.js';
10
- export { a as AgentErrorEvent, A as AgentEvent, b as AgentMessageEvent, e as AgentRunErrorCode, c as AgentToolCallEvent, d as AgentToolResultEvent } from '../agent-events-B3KNV9ER.js';
10
+ export { a as AgentErrorEvent, A as AgentEvent, b as AgentMessageEvent, f as AgentRunErrorCode, c as AgentThinkingEvent, d as AgentToolCallEvent, e as AgentToolResultEvent } from '../agent-events-DosDXkSV.js';
11
11
  export { AuthRequiredError, BackupCode, BackupCodeOptions, OidcMetadata, PkceChallenge, SessionConfig, SessionManager, SessionManagerWeb, SessionMeta, ThrottleOptions, ThrottleState, TotpAlgorithm, TotpOptions, TotpUriOptions, VerifyTotpOptions, _resetKeyCacheForTests, assertProductionSecret, checkThrottle, clearOidcCache, createSessionManager, createSessionManagerWeb, decrypt, discoverOidcProvider, encrypt, generateBackupCodes, generateNonce, generateOAuthState, generatePkceChallenge, generateTotp, generateTotpSecret, pkceChallengeFromVerifier, recordAttempt, requireAuth, rotateIfNeeded, rotateIfNeededWeb, totpUri, verifyBackupCode, verifyOAuthState, verifyTotp } from './auth/index.js';
12
12
  export { InMemoryUsageStorage, ToolHookEvent, ToolUsageRecord, TrackAgentRunInput, TrackAgentRunOptions, TrackAgentToolsHooks, TrackAgentToolsOptions, UsageQuery, UsageRecord, UsageResult, UsageStorageAdapter, trackAgentRun, trackAgentTools } from './cost/index.js';
13
13
  export { CRON_MANIFEST_SCHEMA_VERSION, CronConcurrencyPolicy, CronContext, CronDefinition, CronManifest, CronManifestEntry, CronNode, CronOptions, CronScheduler, DuplicateCronNameError, ExistingConfigUnparseableError, buildCronManifest, convertToAwsCron, createCronScheduler, defineCron, scanCrons, translateCronToAws, translateCronToCloudflare, translateCronToDeno, translateCronToVercel, validateCronSchedule, writeCronManifest } from './cron/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "theokit",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "Apache-2.0",
@@ -109,7 +109,7 @@
109
109
  "dist"
110
110
  ],
111
111
  "dependencies": {
112
- "@theokit/agents": "^0.20.0",
112
+ "@theokit/agents": "^0.21.0",
113
113
  "@theokit/http": "^0.5.4",
114
114
  "@vitejs/plugin-react": "^4.7.0",
115
115
  "busboy": "^1.6.0",