@everworker/oneringai 0.4.5 → 0.4.7

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/README.md CHANGED
@@ -1029,6 +1029,22 @@ console.log(detailed.words); // [{ word, start, end }, ...]
1029
1029
  const english = await stt.translate(frenchAudio);
1030
1030
  ```
1031
1031
 
1032
+ **Streaming TTS** — for real-time voice applications:
1033
+
1034
+ ```typescript
1035
+ // Stream audio chunks as they arrive from the API
1036
+ for await (const chunk of tts.synthesizeStream('Hello!', { format: 'pcm' })) {
1037
+ if (chunk.audio.length > 0) playPCMChunk(chunk.audio); // 24kHz 16-bit LE mono
1038
+ if (chunk.isFinal) break;
1039
+ }
1040
+
1041
+ // VoiceStream wraps agent text streams with interleaved audio events
1042
+ const voice = VoiceStream.create({
1043
+ ttsConnector: 'openai', ttsModel: 'tts-1-hd', voice: 'nova',
1044
+ });
1045
+ for await (const event of voice.wrap(agent.stream('Tell me a story'))) { ... }
1046
+ ```
1047
+
1032
1048
  **Available Models:**
1033
1049
  - **TTS**: OpenAI (`tts-1`, `tts-1-hd`, `gpt-4o-mini-tts`), Google (`gemini-tts`)
1034
1050
  - **STT**: OpenAI (`whisper-1`, `gpt-4o-transcribe`), Groq (`whisper-large-v3` - 12x cheaper!)
@@ -1642,7 +1658,7 @@ await agent.run('Find available meeting slots for alice and bob this week');
1642
1658
 
1643
1659
  Supports both **delegated** (`/me` — user signs in) and **application** (`/users/{id}` — app-only) permission modes. See the [User Guide](./USER_GUIDE.md#microsoft-graph-connector-tools) for full parameter reference.
1644
1660
 
1645
- ### 23. Tool Catalog (NEW)
1661
+ ### 23. Tool Catalog
1646
1662
 
1647
1663
  When agents have 100+ available tools, sending all definitions to the LLM wastes tokens and degrades performance. The Tool Catalog lets agents discover and load only the categories they need:
1648
1664
 
@@ -1659,13 +1675,21 @@ ToolCatalogRegistry.registerTools('knowledge', [
1659
1675
  { name: 'entity_search', displayName: 'Entity Search', description: 'Search entities', tool: entitySearchTool, safeByDefault: true },
1660
1676
  ]);
1661
1677
 
1662
- // Enable tool catalog on an agent
1678
+ // Enable tool catalog with scoping
1663
1679
  const agent = Agent.create({
1664
1680
  connector: 'openai',
1665
1681
  model: 'gpt-4',
1682
+ // Identities control which connector categories are visible
1683
+ identities: [{ connector: 'github' }, { connector: 'slack' }],
1666
1684
  context: {
1667
1685
  features: { toolCatalog: true },
1668
- toolCategories: ['filesystem', 'knowledge'], // optional scope
1686
+ toolCategories: ['filesystem', 'knowledge'], // scope for built-in categories
1687
+ plugins: {
1688
+ toolCatalog: {
1689
+ pinned: ['filesystem'], // always loaded, LLM can't unload
1690
+ autoLoadCategories: ['knowledge'], // pre-loaded, LLM can unload
1691
+ },
1692
+ },
1669
1693
  },
1670
1694
  });
1671
1695
 
@@ -1676,8 +1700,10 @@ await agent.run('Search for information about quantum computing');
1676
1700
 
1677
1701
  **Key Features:**
1678
1702
  - **Dynamic loading** — Agent loads only needed categories, saving token budget
1679
- - **Category scoping** — Restrict visible categories per agent (allowlist/blocklist)
1680
- - **Connector discovery** — Connector tools auto-discovered as categories
1703
+ - **Pinned categories** — Always-loaded categories that the LLM cannot unload
1704
+ - **Dual scoping** — `toolCategories` scopes built-in categories, `identities` scopes connector categories
1705
+ - **Dynamic instructions** — LLM sees exactly which categories are available, with `[PINNED]` markers
1706
+ - **Connector discovery** — Connector tools auto-discovered as categories, filtered by `identities`
1681
1707
  - **Registry API** — `ToolCatalogRegistry.resolveTools()` for app-level tool resolution
1682
1708
 
1683
1709
  See the [User Guide](./USER_GUIDE.md#tool-catalog) for full documentation.
@@ -1830,4 +1856,4 @@ MIT License - See [LICENSE](./LICENSE) file.
1830
1856
 
1831
1857
  ---
1832
1858
 
1833
- **Version:** 0.4.4 | **Last Updated:** 2026-02-26 | **[User Guide](./USER_GUIDE.md)** | **[API Reference](./API_REFERENCE.md)** | **[Changelog](./CHANGELOG.md)**
1859
+ **Version:** 0.4.7 | **Last Updated:** 2026-03-10 | **[User Guide](./USER_GUIDE.md)** | **[API Reference](./API_REFERENCE.md)** | **[Changelog](./CHANGELOG.md)**
@@ -230,11 +230,11 @@ declare class ImageGeneration {
230
230
  /**
231
231
  * Supported image sizes by model
232
232
  */
233
- type ImageSize = '256x256' | '512x512' | '1024x1024' | '1024x1536' | '1536x1024' | '1792x1024' | '1024x1792' | 'auto';
233
+ type ImageSize = '256x256' | '512x512' | '1024x1024' | '1024x1536' | '1536x1024' | '1792x1024' | '1024x1792' | '1536x1536' | 'auto';
234
234
  /**
235
235
  * Supported aspect ratios
236
236
  */
237
- type AspectRatio = '1:1' | '3:4' | '4:3' | '9:16' | '16:9' | '3:2' | '2:3';
237
+ type AspectRatio = '1:1' | '3:4' | '4:3' | '9:16' | '16:9' | '3:2' | '2:3' | '1:4' | '4:1' | '1:8' | '8:1' | '2:1' | '1:2';
238
238
  /**
239
239
  * Image model capabilities
240
240
  */
@@ -309,6 +309,12 @@ declare const IMAGE_MODELS: {
309
309
  readonly IMAGEN_4_ULTRA: "imagen-4.0-ultra-generate-001";
310
310
  /** Imagen 4.0 Fast: Optimized for speed */
311
311
  readonly IMAGEN_4_FAST: "imagen-4.0-fast-generate-001";
312
+ /** Nano Banana 2: Gemini 3.1 Flash native image gen with 4K support */
313
+ readonly GEMINI_3_1_FLASH_IMAGE: "gemini-3.1-flash-image-preview";
314
+ /** Nano Banana Pro: Gemini 3 Pro professional design engine with reasoning */
315
+ readonly GEMINI_3_PRO_IMAGE: "gemini-3-pro-image-preview";
316
+ /** Nano Banana: Gemini 2.5 Flash native image gen/editing */
317
+ readonly GEMINI_2_5_FLASH_IMAGE: "gemini-2.5-flash-image";
312
318
  };
313
319
  readonly grok: {
314
320
  /** Grok Imagine Image: xAI image generation with editing support */
@@ -230,11 +230,11 @@ declare class ImageGeneration {
230
230
  /**
231
231
  * Supported image sizes by model
232
232
  */
233
- type ImageSize = '256x256' | '512x512' | '1024x1024' | '1024x1536' | '1536x1024' | '1792x1024' | '1024x1792' | 'auto';
233
+ type ImageSize = '256x256' | '512x512' | '1024x1024' | '1024x1536' | '1536x1024' | '1792x1024' | '1024x1792' | '1536x1536' | 'auto';
234
234
  /**
235
235
  * Supported aspect ratios
236
236
  */
237
- type AspectRatio = '1:1' | '3:4' | '4:3' | '9:16' | '16:9' | '3:2' | '2:3';
237
+ type AspectRatio = '1:1' | '3:4' | '4:3' | '9:16' | '16:9' | '3:2' | '2:3' | '1:4' | '4:1' | '1:8' | '8:1' | '2:1' | '1:2';
238
238
  /**
239
239
  * Image model capabilities
240
240
  */
@@ -309,6 +309,12 @@ declare const IMAGE_MODELS: {
309
309
  readonly IMAGEN_4_ULTRA: "imagen-4.0-ultra-generate-001";
310
310
  /** Imagen 4.0 Fast: Optimized for speed */
311
311
  readonly IMAGEN_4_FAST: "imagen-4.0-fast-generate-001";
312
+ /** Nano Banana 2: Gemini 3.1 Flash native image gen with 4K support */
313
+ readonly GEMINI_3_1_FLASH_IMAGE: "gemini-3.1-flash-image-preview";
314
+ /** Nano Banana Pro: Gemini 3 Pro professional design engine with reasoning */
315
+ readonly GEMINI_3_PRO_IMAGE: "gemini-3-pro-image-preview";
316
+ /** Nano Banana: Gemini 2.5 Flash native image gen/editing */
317
+ readonly GEMINI_2_5_FLASH_IMAGE: "gemini-2.5-flash-image";
312
318
  };
313
319
  readonly grok: {
314
320
  /** Grok Imagine Image: xAI image generation with editing support */
@@ -1,4 +1,4 @@
1
- export { a3 as AfterToolContext, a4 as AgentEventName, w as AgentEvents, a5 as AgenticLoopEventName, a6 as AgenticLoopEvents, a7 as ApprovalResult, a8 as ApproveToolContext, z as AuditEntry, a9 as BeforeToolContext, be as ExecutionCompleteEvent, al as ExecutionConfig, E as ExecutionContext, y as ExecutionMetrics, bf as ExecutionStartEvent, v as HistoryMode, am as Hook, H as HookConfig, an as HookManager, D as HookName, bg as LLMRequestEvent, bh as LLMResponseEvent, aw as ModifyingHook, bi as ToolCompleteEvent, aU as ToolModification, bj as ToolStartEvent } from '../../index-CsQOVhqe.cjs';
1
+ export { a4 as AfterToolContext, a5 as AgentEventName, w as AgentEvents, a6 as AgenticLoopEventName, a7 as AgenticLoopEvents, a8 as ApprovalResult, a9 as ApproveToolContext, z as AuditEntry, ac as BeforeToolContext, bk as ExecutionCompleteEvent, ao as ExecutionConfig, E as ExecutionContext, y as ExecutionMetrics, bl as ExecutionStartEvent, v as HistoryMode, ap as Hook, H as HookConfig, aq as HookManager, D as HookName, bm as LLMRequestEvent, bn as LLMResponseEvent, az as ModifyingHook, bo as ToolCompleteEvent, aX as ToolModification, bp as ToolStartEvent } from '../../index-D8RCwpK9.cjs';
2
2
  import '../../IProvider-B8sqUzJG.cjs';
3
3
  import '../../Vendor-DYh_bzwo.cjs';
4
4
  import 'eventemitter3';
@@ -1,4 +1,4 @@
1
- export { a3 as AfterToolContext, a4 as AgentEventName, w as AgentEvents, a5 as AgenticLoopEventName, a6 as AgenticLoopEvents, a7 as ApprovalResult, a8 as ApproveToolContext, z as AuditEntry, a9 as BeforeToolContext, be as ExecutionCompleteEvent, al as ExecutionConfig, E as ExecutionContext, y as ExecutionMetrics, bf as ExecutionStartEvent, v as HistoryMode, am as Hook, H as HookConfig, an as HookManager, D as HookName, bg as LLMRequestEvent, bh as LLMResponseEvent, aw as ModifyingHook, bi as ToolCompleteEvent, aU as ToolModification, bj as ToolStartEvent } from '../../index-C6ApwIzB.js';
1
+ export { a4 as AfterToolContext, a5 as AgentEventName, w as AgentEvents, a6 as AgenticLoopEventName, a7 as AgenticLoopEvents, a8 as ApprovalResult, a9 as ApproveToolContext, z as AuditEntry, ac as BeforeToolContext, bk as ExecutionCompleteEvent, ao as ExecutionConfig, E as ExecutionContext, y as ExecutionMetrics, bl as ExecutionStartEvent, v as HistoryMode, ap as Hook, H as HookConfig, aq as HookManager, D as HookName, bm as LLMRequestEvent, bn as LLMResponseEvent, az as ModifyingHook, bo as ToolCompleteEvent, aX as ToolModification, bp as ToolStartEvent } from '../../index-Blci0FEd.js';
2
2
  import '../../IProvider-CxDUGl6n.js';
3
3
  import '../../Vendor-DYh_bzwo.js';
4
4
  import 'eventemitter3';
@@ -3228,7 +3228,13 @@ var IMAGE_MODELS = {
3228
3228
  /** Imagen 4.0 Ultra: Highest quality */
3229
3229
  IMAGEN_4_ULTRA: "imagen-4.0-ultra-generate-001",
3230
3230
  /** Imagen 4.0 Fast: Optimized for speed */
3231
- IMAGEN_4_FAST: "imagen-4.0-fast-generate-001"
3231
+ IMAGEN_4_FAST: "imagen-4.0-fast-generate-001",
3232
+ /** Nano Banana 2: Gemini 3.1 Flash native image gen with 4K support */
3233
+ GEMINI_3_1_FLASH_IMAGE: "gemini-3.1-flash-image-preview",
3234
+ /** Nano Banana Pro: Gemini 3 Pro professional design engine with reasoning */
3235
+ GEMINI_3_PRO_IMAGE: "gemini-3-pro-image-preview",
3236
+ /** Nano Banana: Gemini 2.5 Flash native image gen/editing */
3237
+ GEMINI_2_5_FLASH_IMAGE: "gemini-2.5-flash-image"
3232
3238
  },
3233
3239
  [Vendor.Grok]: {
3234
3240
  /** Grok Imagine Image: xAI image generation with editing support */
@@ -3412,7 +3418,7 @@ var IMAGE_MODEL_REGISTRY = {
3412
3418
  sources: {
3413
3419
  documentation: "https://ai.google.dev/gemini-api/docs/imagen",
3414
3420
  pricing: "https://ai.google.dev/pricing",
3415
- lastVerified: "2026-01-25"
3421
+ lastVerified: "2026-03-04"
3416
3422
  },
3417
3423
  capabilities: {
3418
3424
  sizes: ["1024x1024"],
@@ -3523,7 +3529,7 @@ var IMAGE_MODEL_REGISTRY = {
3523
3529
  sources: {
3524
3530
  documentation: "https://ai.google.dev/gemini-api/docs/imagen",
3525
3531
  pricing: "https://ai.google.dev/pricing",
3526
- lastVerified: "2026-01-25"
3532
+ lastVerified: "2026-03-04"
3527
3533
  },
3528
3534
  capabilities: {
3529
3535
  sizes: ["1024x1024"],
@@ -3620,7 +3626,8 @@ var IMAGE_MODEL_REGISTRY = {
3620
3626
  }
3621
3627
  },
3622
3628
  pricing: {
3623
- perImage: 0.08,
3629
+ perImage: 0.06,
3630
+ // Updated per official pricing page (was $0.08)
3624
3631
  currency: "USD"
3625
3632
  }
3626
3633
  },
@@ -3634,7 +3641,7 @@ var IMAGE_MODEL_REGISTRY = {
3634
3641
  sources: {
3635
3642
  documentation: "https://ai.google.dev/gemini-api/docs/imagen",
3636
3643
  pricing: "https://ai.google.dev/pricing",
3637
- lastVerified: "2026-01-25"
3644
+ lastVerified: "2026-03-04"
3638
3645
  },
3639
3646
  capabilities: {
3640
3647
  sizes: ["1024x1024"],
@@ -3735,6 +3742,141 @@ var IMAGE_MODEL_REGISTRY = {
3735
3742
  currency: "USD"
3736
3743
  }
3737
3744
  },
3745
+ // ======================== Google Nano Banana (Gemini Native Image) ========================
3746
+ "gemini-3.1-flash-image-preview": {
3747
+ name: "gemini-3.1-flash-image-preview",
3748
+ displayName: "Nano Banana 2 (Gemini 3.1 Flash Image)",
3749
+ provider: Vendor.Google,
3750
+ description: "High-efficiency native image generation and editing with 4K support and thinking capabilities",
3751
+ isActive: true,
3752
+ releaseDate: "2026-02-01",
3753
+ sources: {
3754
+ documentation: "https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-image-preview",
3755
+ pricing: "https://ai.google.dev/pricing",
3756
+ lastVerified: "2026-03-04"
3757
+ },
3758
+ capabilities: {
3759
+ sizes: ["512x512", "1024x1024", "1536x1536", "auto"],
3760
+ aspectRatios: ["1:1", "1:4", "4:1", "1:8", "8:1"],
3761
+ maxImagesPerRequest: 4,
3762
+ outputFormats: ["png", "jpeg"],
3763
+ features: {
3764
+ generation: true,
3765
+ editing: true,
3766
+ variations: false,
3767
+ styleControl: false,
3768
+ qualityControl: true,
3769
+ // Multiple resolution tiers: 0.5K, 1K, 2K, 4K
3770
+ transparency: false,
3771
+ promptRevision: false
3772
+ },
3773
+ limits: { maxPromptLength: 131072 },
3774
+ // 131K input tokens
3775
+ vendorOptions: {
3776
+ outputImageResolution: {
3777
+ type: "enum",
3778
+ label: "Resolution",
3779
+ description: "Output image resolution tier",
3780
+ enum: ["0.5K", "1K", "2K", "4K"],
3781
+ default: "1K",
3782
+ controlType: "select"
3783
+ }
3784
+ }
3785
+ },
3786
+ pricing: {
3787
+ // Per-image, varies by resolution: $0.045 (512px), $0.067 (1K), $0.101 (2K), $0.151 (4K)
3788
+ perImageStandard: 0.067,
3789
+ // 1K default
3790
+ perImageHD: 0.151,
3791
+ // 4K
3792
+ currency: "USD"
3793
+ }
3794
+ },
3795
+ "gemini-3-pro-image-preview": {
3796
+ name: "gemini-3-pro-image-preview",
3797
+ displayName: "Nano Banana Pro (Gemini 3 Pro Image)",
3798
+ provider: Vendor.Google,
3799
+ description: "Professional design engine with reasoning for studio-quality 4K visuals, complex layouts, and precise text rendering",
3800
+ isActive: true,
3801
+ releaseDate: "2025-11-01",
3802
+ sources: {
3803
+ documentation: "https://ai.google.dev/gemini-api/docs/models/gemini-3-pro-image-preview",
3804
+ pricing: "https://ai.google.dev/pricing",
3805
+ lastVerified: "2026-03-04"
3806
+ },
3807
+ capabilities: {
3808
+ sizes: ["1024x1024", "auto"],
3809
+ aspectRatios: ["1:1", "3:4", "4:3", "9:16", "16:9"],
3810
+ maxImagesPerRequest: 4,
3811
+ outputFormats: ["png", "jpeg"],
3812
+ features: {
3813
+ generation: true,
3814
+ editing: true,
3815
+ variations: false,
3816
+ styleControl: true,
3817
+ // Reasoning-driven design
3818
+ qualityControl: true,
3819
+ // 1K, 2K, 4K tiers
3820
+ transparency: false,
3821
+ promptRevision: false
3822
+ },
3823
+ limits: { maxPromptLength: 65536 },
3824
+ // 65K input tokens
3825
+ vendorOptions: {
3826
+ outputImageResolution: {
3827
+ type: "enum",
3828
+ label: "Resolution",
3829
+ description: "Output image resolution tier",
3830
+ enum: ["1K", "2K", "4K"],
3831
+ default: "1K",
3832
+ controlType: "select"
3833
+ }
3834
+ }
3835
+ },
3836
+ pricing: {
3837
+ // $0.134 per 1K/2K image, $0.24 per 4K image
3838
+ perImageStandard: 0.134,
3839
+ // 1K/2K
3840
+ perImageHD: 0.24,
3841
+ // 4K
3842
+ currency: "USD"
3843
+ }
3844
+ },
3845
+ "gemini-2.5-flash-image": {
3846
+ name: "gemini-2.5-flash-image",
3847
+ displayName: "Nano Banana (Gemini 2.5 Flash Image)",
3848
+ provider: Vendor.Google,
3849
+ description: "Native image generation and editing designed for fast, creative workflows",
3850
+ isActive: true,
3851
+ releaseDate: "2025-10-01",
3852
+ sources: {
3853
+ documentation: "https://ai.google.dev/gemini-api/docs/models/gemini-2.5-flash-image",
3854
+ pricing: "https://ai.google.dev/pricing",
3855
+ lastVerified: "2026-03-04"
3856
+ },
3857
+ capabilities: {
3858
+ sizes: ["1024x1024", "auto"],
3859
+ aspectRatios: ["1:1", "3:4", "4:3", "9:16", "16:9"],
3860
+ maxImagesPerRequest: 4,
3861
+ outputFormats: ["png", "jpeg"],
3862
+ features: {
3863
+ generation: true,
3864
+ editing: true,
3865
+ variations: false,
3866
+ styleControl: false,
3867
+ qualityControl: false,
3868
+ transparency: false,
3869
+ promptRevision: false
3870
+ },
3871
+ limits: { maxPromptLength: 65536 }
3872
+ // 65K input tokens
3873
+ },
3874
+ pricing: {
3875
+ perImage: 0.039,
3876
+ // $0.039 per image
3877
+ currency: "USD"
3878
+ }
3879
+ },
3738
3880
  // ======================== xAI Grok ========================
3739
3881
  "grok-imagine-image": {
3740
3882
  name: "grok-imagine-image",
@@ -3746,11 +3888,11 @@ var IMAGE_MODEL_REGISTRY = {
3746
3888
  sources: {
3747
3889
  documentation: "https://docs.x.ai/docs/guides/image-generation",
3748
3890
  pricing: "https://docs.x.ai/docs/models",
3749
- lastVerified: "2026-02-01"
3891
+ lastVerified: "2026-03-04"
3750
3892
  },
3751
3893
  capabilities: {
3752
3894
  sizes: ["1024x1024"],
3753
- aspectRatios: ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3"],
3895
+ aspectRatios: ["1:1", "4:3", "3:4", "16:9", "9:16", "3:2", "2:3", "2:1", "1:2"],
3754
3896
  maxImagesPerRequest: 10,
3755
3897
  outputFormats: ["png", "jpeg"],
3756
3898
  features: {