@theokit/sdk 1.8.1 → 2.0.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.
Files changed (83) hide show
  1. package/CHANGELOG.md +70 -22
  2. package/bin/init-claude.mjs +0 -0
  3. package/dist/a2a/index.cjs +12592 -12884
  4. package/dist/a2a/index.cjs.map +1 -1
  5. package/dist/a2a/index.js +12592 -12884
  6. package/dist/a2a/index.js.map +1 -1
  7. package/dist/{cron-BnywDYLq.d.cts → cron-Bse1MbaE.d.cts} +52 -2
  8. package/dist/{cron-CtZvJD9J.d.ts → cron-Ci_NUkUj.d.ts} +52 -2
  9. package/dist/cron.cjs +8763 -9062
  10. package/dist/cron.cjs.map +1 -1
  11. package/dist/cron.d.cts +1 -1
  12. package/dist/cron.d.ts +1 -1
  13. package/dist/cron.js +8763 -9062
  14. package/dist/cron.js.map +1 -1
  15. package/dist/eval.cjs +8776 -9075
  16. package/dist/eval.cjs.map +1 -1
  17. package/dist/eval.js +8776 -9075
  18. package/dist/eval.js.map +1 -1
  19. package/dist/index.cjs +11217 -10037
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.d.cts +174 -3
  22. package/dist/index.d.ts +174 -3
  23. package/dist/index.js +11217 -10038
  24. package/dist/index.js.map +1 -1
  25. package/dist/internal/runtime/{cloud-config-serializer.d.ts → cloud/cloud-config-serializer.d.ts} +1 -1
  26. package/dist/internal/runtime/{real-cloud-run.d.ts → cloud/real-cloud-run.d.ts} +1 -1
  27. package/dist/internal/runtime/fixtures/fixture-scripts.d.ts +1 -1
  28. package/dist/internal/runtime/fork-agent.d.ts +1 -1
  29. package/dist/internal/runtime/{local-agent-bootstrap.d.ts → local-agent/local-agent-bootstrap.d.ts} +4 -4
  30. package/dist/internal/runtime/{local-agent-dispatch.d.ts → local-agent/local-agent-dispatch.d.ts} +7 -7
  31. package/dist/internal/runtime/{local-agent-memory-hooks.d.ts → local-agent/local-agent-memory-hooks.d.ts} +2 -2
  32. package/dist/internal/runtime/{local-agent-memory-provider.d.ts → local-agent/local-agent-memory-provider.d.ts} +2 -2
  33. package/dist/internal/runtime/{real-local-run.d.ts → local-agent/real-local-run.d.ts} +1 -1
  34. package/dist/internal/runtime/{memory-path-selector.d.ts → memory/memory-path-selector.d.ts} +1 -1
  35. package/dist/internal/runtime/{memory-provider.d.ts → memory/memory-provider.d.ts} +2 -2
  36. package/dist/internal/runtime/{memory-store.d.ts → memory/memory-store.d.ts} +1 -1
  37. package/dist/internal/runtime/skills/subagents-loader.d.ts +1 -0
  38. package/dist/types/agent.d.ts +3 -3
  39. package/dist/types/fork.d.ts +49 -0
  40. package/dist/types/goal-events.d.ts +1 -1
  41. package/package.json +15 -26
  42. package/dist/rag/index.cjs +0 -136
  43. package/dist/rag/index.cjs.map +0 -1
  44. package/dist/rag/index.d.cts +0 -11
  45. package/dist/rag/index.d.ts +0 -11
  46. package/dist/rag/index.js +0 -129
  47. package/dist/rag/index.js.map +0 -1
  48. package/dist/rag/reranker.d.cts +0 -26
  49. package/dist/rag/reranker.d.ts +0 -26
  50. package/dist/rag/retriever.d.cts +0 -25
  51. package/dist/rag/retriever.d.ts +0 -25
  52. package/dist/rag/text-splitter.d.cts +0 -12
  53. package/dist/rag/text-splitter.d.ts +0 -12
  54. package/dist/rag/types.d.cts +0 -37
  55. package/dist/rag/types.d.ts +0 -37
  56. package/dist/voice/index.d.ts +0 -7
  57. package/dist/voice/openai-realtime.d.ts +0 -21
  58. package/dist/voice/types.d.ts +0 -35
  59. /package/dist/internal/{runtime/cloud-agent.d.ts → agent-loop/budget-gate.d.ts} +0 -0
  60. /package/dist/internal/runtime/{budget-tracker.d.ts → budget/budget-tracker.d.ts} +0 -0
  61. /package/dist/internal/runtime/{budget.d.ts → budget/budget.d.ts} +0 -0
  62. /package/dist/internal/runtime/{cloud-run.d.ts → cloud/cloud-agent.d.ts} +0 -0
  63. /package/dist/internal/runtime/{cloud-payload-types.d.ts → cloud/cloud-payload-types.d.ts} +0 -0
  64. /package/dist/internal/runtime/{cloud-tool-parity.d.ts → cloud/cloud-run.d.ts} +0 -0
  65. /package/dist/internal/runtime/{local-agent-memory.d.ts → cloud/cloud-tool-parity.d.ts} +0 -0
  66. /package/dist/internal/runtime/{hooks-executor.d.ts → hooks/hooks-executor.d.ts} +0 -0
  67. /package/dist/internal/runtime/{hooks-frontmatter.d.ts → hooks/hooks-frontmatter.d.ts} +0 -0
  68. /package/dist/internal/runtime/{hooks-source.d.ts → hooks/hooks-source.d.ts} +0 -0
  69. /package/dist/internal/runtime/{local-agent-invalidate.d.ts → local-agent/local-agent-invalidate.d.ts} +0 -0
  70. /package/dist/internal/runtime/{local-agent-memory-direct.d.ts → local-agent/local-agent-memory-direct.d.ts} +0 -0
  71. /package/dist/internal/runtime/{local-agent-send.d.ts → local-agent/local-agent-memory.d.ts} +0 -0
  72. /package/dist/internal/runtime/{local-agent-personality-extensions.d.ts → local-agent/local-agent-personality-extensions.d.ts} +0 -0
  73. /package/dist/internal/runtime/{local-agent-plugins.d.ts → local-agent/local-agent-plugins.d.ts} +0 -0
  74. /package/dist/internal/runtime/{local-agent-runtime-extensions.d.ts → local-agent/local-agent-runtime-extensions.d.ts} +0 -0
  75. /package/dist/internal/runtime/{local-agent.d.ts → local-agent/local-agent-send.d.ts} +0 -0
  76. /package/dist/internal/runtime/{local-agent-task-wrap.d.ts → local-agent/local-agent-task-wrap.d.ts} +0 -0
  77. /package/dist/internal/runtime/{local-run.d.ts → local-agent/local-agent.d.ts} +0 -0
  78. /package/dist/internal/runtime/{skills-manager.d.ts → local-agent/local-run.d.ts} +0 -0
  79. /package/dist/internal/runtime/{agent-session-store.d.ts → session/agent-session-store.d.ts} +0 -0
  80. /package/dist/internal/runtime/{agent-session.d.ts → session/agent-session.d.ts} +0 -0
  81. /package/dist/internal/runtime/{session-types.d.ts → session/session-types.d.ts} +0 -0
  82. /package/dist/internal/runtime/{skill-frontmatter.d.ts → skills/skill-frontmatter.d.ts} +0 -0
  83. /package/dist/internal/runtime/{subagents-loader.d.ts → skills/skills-manager.d.ts} +0 -0
@@ -1,26 +0,0 @@
1
- /**
2
- * Reranker implementations for RAG pipelines (T11.1, ADR D448).
3
- *
4
- * NoopReranker: passes through results unchanged (baseline).
5
- * CohereReranker: calls the Cohere Rerank API (optional peer dep).
6
- *
7
- * @public
8
- */
9
- import type { RankedChunk, Reranker, RetrievalResult } from "./types.js";
10
- export declare class NoopReranker implements Reranker {
11
- rerank(_query: string, chunks: RetrievalResult[]): Promise<RankedChunk[]>;
12
- }
13
- type MockRerankFn = (query: string, docs: RetrievalResult[]) => Promise<RankedChunk[]>;
14
- export interface CohereRerankerOptions {
15
- apiKey: string;
16
- model?: string;
17
- _mockRerank?: MockRerankFn;
18
- }
19
- export declare class CohereReranker implements Reranker {
20
- private readonly _apiKey;
21
- private readonly _model;
22
- private readonly _mockRerank?;
23
- constructor(opts: CohereRerankerOptions);
24
- rerank(query: string, chunks: RetrievalResult[]): Promise<RankedChunk[]>;
25
- }
26
- export {};
@@ -1,26 +0,0 @@
1
- /**
2
- * Reranker implementations for RAG pipelines (T11.1, ADR D448).
3
- *
4
- * NoopReranker: passes through results unchanged (baseline).
5
- * CohereReranker: calls the Cohere Rerank API (optional peer dep).
6
- *
7
- * @public
8
- */
9
- import type { RankedChunk, Reranker, RetrievalResult } from "./types.js";
10
- export declare class NoopReranker implements Reranker {
11
- rerank(_query: string, chunks: RetrievalResult[]): Promise<RankedChunk[]>;
12
- }
13
- type MockRerankFn = (query: string, docs: RetrievalResult[]) => Promise<RankedChunk[]>;
14
- export interface CohereRerankerOptions {
15
- apiKey: string;
16
- model?: string;
17
- _mockRerank?: MockRerankFn;
18
- }
19
- export declare class CohereReranker implements Reranker {
20
- private readonly _apiKey;
21
- private readonly _model;
22
- private readonly _mockRerank?;
23
- constructor(opts: CohereRerankerOptions);
24
- rerank(query: string, chunks: RetrievalResult[]): Promise<RankedChunk[]>;
25
- }
26
- export {};
@@ -1,25 +0,0 @@
1
- /**
2
- * Retriever implementations for RAG pipelines (T11.1, ADR D448).
3
- *
4
- * VectorRetriever wraps any index that implements `search(query, topK)`.
5
- * The Retriever interface is the contract — consumers depend on the interface,
6
- * implementations depend on the index adapter (DIP per architecture.md § 2).
7
- *
8
- * @public
9
- */
10
- import type { RetrievalResult, Retriever } from "./types.js";
11
- export interface VectorIndex {
12
- search(query: string, topK: number): Promise<RetrievalResult[]>;
13
- }
14
- export interface VectorRetrieverOptions {
15
- index: VectorIndex;
16
- topK?: number;
17
- }
18
- export declare class VectorRetriever implements Retriever {
19
- private readonly _index;
20
- private readonly _defaultTopK;
21
- constructor(opts: VectorRetrieverOptions);
22
- retrieve(query: string, options?: {
23
- topK?: number;
24
- }): Promise<RetrievalResult[]>;
25
- }
@@ -1,25 +0,0 @@
1
- /**
2
- * Retriever implementations for RAG pipelines (T11.1, ADR D448).
3
- *
4
- * VectorRetriever wraps any index that implements `search(query, topK)`.
5
- * The Retriever interface is the contract — consumers depend on the interface,
6
- * implementations depend on the index adapter (DIP per architecture.md § 2).
7
- *
8
- * @public
9
- */
10
- import type { RetrievalResult, Retriever } from "./types.js";
11
- export interface VectorIndex {
12
- search(query: string, topK: number): Promise<RetrievalResult[]>;
13
- }
14
- export interface VectorRetrieverOptions {
15
- index: VectorIndex;
16
- topK?: number;
17
- }
18
- export declare class VectorRetriever implements Retriever {
19
- private readonly _index;
20
- private readonly _defaultTopK;
21
- constructor(opts: VectorRetrieverOptions);
22
- retrieve(query: string, options?: {
23
- topK?: number;
24
- }): Promise<RetrievalResult[]>;
25
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * Text splitting strategies for RAG pipelines (T11.1, ADR D448).
3
- *
4
- * Three strategies: character, sentence, recursive (paragraph→sentence→char).
5
- * All return Chunk[] with text + index. Empty input → empty array (EC-5).
6
- *
7
- * @public
8
- */
9
- import type { Chunk, SplitOptions } from "./types.js";
10
- export declare function splitByCharacter(text: string, opts: SplitOptions): Chunk[];
11
- export declare function splitBySentence(text: string, opts: SplitOptions): Chunk[];
12
- export declare function splitRecursive(text: string, opts: SplitOptions): Chunk[];
@@ -1,12 +0,0 @@
1
- /**
2
- * Text splitting strategies for RAG pipelines (T11.1, ADR D448).
3
- *
4
- * Three strategies: character, sentence, recursive (paragraph→sentence→char).
5
- * All return Chunk[] with text + index. Empty input → empty array (EC-5).
6
- *
7
- * @public
8
- */
9
- import type { Chunk, SplitOptions } from "./types.js";
10
- export declare function splitByCharacter(text: string, opts: SplitOptions): Chunk[];
11
- export declare function splitBySentence(text: string, opts: SplitOptions): Chunk[];
12
- export declare function splitRecursive(text: string, opts: SplitOptions): Chunk[];
@@ -1,37 +0,0 @@
1
- /**
2
- * RAG types — Document, Chunk, RetrievalResult (T11.1, ADR D448).
3
- * @public
4
- */
5
- export interface Document {
6
- id: string;
7
- text: string;
8
- metadata?: Record<string, unknown>;
9
- }
10
- export interface Chunk {
11
- text: string;
12
- index: number;
13
- metadata?: Record<string, unknown>;
14
- }
15
- export interface RetrievalResult {
16
- text: string;
17
- score: number;
18
- metadata?: Record<string, unknown>;
19
- }
20
- export interface RankedChunk {
21
- text: string;
22
- score: number;
23
- originalIndex: number;
24
- metadata?: Record<string, unknown>;
25
- }
26
- export interface SplitOptions {
27
- chunkSize: number;
28
- overlap?: number;
29
- }
30
- export interface Retriever {
31
- retrieve(query: string, options?: {
32
- topK?: number;
33
- }): Promise<RetrievalResult[]>;
34
- }
35
- export interface Reranker {
36
- rerank(query: string, chunks: RetrievalResult[]): Promise<RankedChunk[]>;
37
- }
@@ -1,37 +0,0 @@
1
- /**
2
- * RAG types — Document, Chunk, RetrievalResult (T11.1, ADR D448).
3
- * @public
4
- */
5
- export interface Document {
6
- id: string;
7
- text: string;
8
- metadata?: Record<string, unknown>;
9
- }
10
- export interface Chunk {
11
- text: string;
12
- index: number;
13
- metadata?: Record<string, unknown>;
14
- }
15
- export interface RetrievalResult {
16
- text: string;
17
- score: number;
18
- metadata?: Record<string, unknown>;
19
- }
20
- export interface RankedChunk {
21
- text: string;
22
- score: number;
23
- originalIndex: number;
24
- metadata?: Record<string, unknown>;
25
- }
26
- export interface SplitOptions {
27
- chunkSize: number;
28
- overlap?: number;
29
- }
30
- export interface Retriever {
31
- retrieve(query: string, options?: {
32
- topK?: number;
33
- }): Promise<RetrievalResult[]>;
34
- }
35
- export interface Reranker {
36
- rerank(query: string, chunks: RetrievalResult[]): Promise<RankedChunk[]>;
37
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * Voice sub-path barrel (T12.3).
3
- * Exported via `@theokit/sdk/voice`.
4
- * @public @experimental
5
- */
6
- export { OpenAIRealtimeVoiceProvider } from "./openai-realtime.js";
7
- export type { STTOptions, STTResult, TTSOptions, TTSResult, VoiceProvider } from "./types.js";
@@ -1,21 +0,0 @@
1
- /**
2
- * OpenAI Realtime voice provider — TTS via OpenAI Audio API (T12.3).
3
- *
4
- * Optional peer dep: none (uses native fetch).
5
- *
6
- * @public @experimental
7
- */
8
- import type { STTOptions, STTResult, TTSOptions, TTSResult, VoiceProvider } from "./types.js";
9
- interface OpenAIRealtimeVoiceProviderOptions {
10
- apiKey: string;
11
- baseUrl?: string;
12
- }
13
- export declare class OpenAIRealtimeVoiceProvider implements VoiceProvider {
14
- readonly name = "openai-realtime";
15
- private readonly _apiKey;
16
- private readonly _baseUrl;
17
- constructor(opts: OpenAIRealtimeVoiceProviderOptions);
18
- textToSpeech(text: string, opts?: TTSOptions): Promise<TTSResult>;
19
- speechToText(audio: Buffer | Uint8Array, opts?: STTOptions): Promise<STTResult>;
20
- }
21
- export {};
@@ -1,35 +0,0 @@
1
- /**
2
- * VoiceProvider interface — foundation for TTS/STT adapters (T12.3).
3
- * @public @experimental
4
- */
5
- export interface TTSOptions {
6
- model?: string;
7
- voice?: string;
8
- speed?: number;
9
- format?: "mp3" | "opus" | "aac" | "flac" | "wav" | "pcm";
10
- }
11
- export interface STTOptions {
12
- model?: string;
13
- language?: string;
14
- prompt?: string;
15
- }
16
- export interface TTSResult {
17
- audio: Buffer | Uint8Array;
18
- format: string;
19
- durationMs?: number;
20
- }
21
- export interface STTResult {
22
- text: string;
23
- language?: string;
24
- durationMs?: number;
25
- segments?: Array<{
26
- start: number;
27
- end: number;
28
- text: string;
29
- }>;
30
- }
31
- export interface VoiceProvider {
32
- readonly name: string;
33
- textToSpeech(text: string, opts?: TTSOptions): Promise<TTSResult>;
34
- speechToText(audio: Buffer | Uint8Array, opts?: STTOptions): Promise<STTResult>;
35
- }