@juspay/neurolink 12.46.1 → 12.47.1

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 (37) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/README.md +75 -50
  3. package/dist/adapters/video/ffmpegAdapter.d.ts +3 -1
  4. package/dist/adapters/video/ffmpegAdapter.js +13 -2
  5. package/dist/browser/neurolink.min.js +421 -421
  6. package/dist/cli/commands/decide.js +2 -2
  7. package/dist/cli/commands/setup.js +8 -6
  8. package/dist/cli/factories/commandFactory.js +1 -1
  9. package/dist/cli/proxy-clients/copilot.js +55 -1
  10. package/dist/constants/contextWindows.js +12 -0
  11. package/dist/constants/enums.d.ts +16 -0
  12. package/dist/constants/enums.js +17 -0
  13. package/dist/core/toolExecutionGuards.d.ts +1 -9
  14. package/dist/core/toolExecutionGuards.js +1 -9
  15. package/dist/factories/providerDescriptors.js +84 -5
  16. package/dist/factories/providerFactory.js +16 -1
  17. package/dist/factories/providerRegistry.js +10 -1
  18. package/dist/files/fileReferenceRegistry.js +3 -3
  19. package/dist/models/manifestRegistry.js +2 -0
  20. package/dist/models/manifests/cloudflareClef.d.ts +16 -0
  21. package/dist/models/manifests/cloudflareClef.js +42 -0
  22. package/dist/neurolink.js +13 -2
  23. package/dist/processors/media/VideoProcessor.js +16 -4
  24. package/dist/providers/cloudflareClef.d.ts +52 -0
  25. package/dist/providers/cloudflareClef.js +331 -0
  26. package/dist/providers/googleNativeGemini3/utils.d.ts +9 -0
  27. package/dist/providers/googleNativeGemini3/utils.js +9 -0
  28. package/dist/providers/systemOneDecision.d.ts +12 -1
  29. package/dist/providers/systemOneDecision.js +70 -18
  30. package/dist/types/decision.d.ts +22 -0
  31. package/dist/types/providers.d.ts +15 -0
  32. package/dist/utils/modelChoices.js +13 -1
  33. package/dist/utils/pricing.js +12 -0
  34. package/dist/utils/providerConfig.d.ts +7 -0
  35. package/dist/utils/providerConfig.js +19 -0
  36. package/docs-site/static/search-index.json +78 -56
  37. package/package.json +2 -1
@@ -2,7 +2,7 @@
2
2
  * Centralized model choices for CLI commands
3
3
  * Derives choices from model enums to ensure consistency
4
4
  */
5
- import { AIProviderName, OpenAIModels, AnthropicModels, GoogleAIModels, BedrockModels, VertexModels, OllamaModels, AzureOpenAIModels, LiteLLMModels, SageMakerModels, OpenRouterModels, NvidiaNimModels, CohereModels, VoyageModels, JinaModels, StabilityModels, IdeogramModels, RecraftModels, TypeSafeModels, LayaModels, XorModels, PerplexityDeciderModels, ReplicateModels, } from "../constants/enums.js";
5
+ import { AIProviderName, OpenAIModels, AnthropicModels, GoogleAIModels, BedrockModels, VertexModels, OllamaModels, AzureOpenAIModels, LiteLLMModels, SageMakerModels, OpenRouterModels, NvidiaNimModels, CohereModels, VoyageModels, JinaModels, StabilityModels, IdeogramModels, RecraftModels, TypeSafeModels, LayaModels, XorModels, PerplexityDeciderModels, CloudflareClefModels, ReplicateModels, } from "../constants/enums.js";
6
6
  import { getCatalogJsonEntries } from "../providers/catalog/loader.js";
7
7
  /**
8
8
  * Looks up the JSON catalog entry for a provider, if it is one of the 11
@@ -399,6 +399,16 @@ const TOP_MODELS_CONFIG = {
399
399
  description: "Recommended - Perplexity decision model that also reads images",
400
400
  },
401
401
  ],
402
+ [AIProviderName.CLOUDFLARE_CLEF]: [
403
+ {
404
+ model: CloudflareClefModels.CLEF,
405
+ description: "Recommended - Cloudflare Clef 27B decision model that also reads images (state limited to ~2,000 tokens)",
406
+ },
407
+ {
408
+ model: CloudflareClefModels.CLEF_FLASH,
409
+ description: "Clef-flash 9B - the faster, cheaper Cloudflare decision model (same ~2,000-token state limit)",
410
+ },
411
+ ],
402
412
  [AIProviderName.AUTO]: [],
403
413
  };
404
414
  /**
@@ -441,6 +451,7 @@ export const DEFAULT_MODELS = {
441
451
  [AIProviderName.LAYA]: LayaModels.TYPED_DECISIONS,
442
452
  [AIProviderName.XOR]: XorModels.XOR_1_1,
443
453
  [AIProviderName.PERPLEXITY_DECIDER]: PerplexityDeciderModels.PPLX_DECIDER_V1_27B,
454
+ [AIProviderName.CLOUDFLARE_CLEF]: CloudflareClefModels.CLEF,
444
455
  };
445
456
  /**
446
457
  * Model enum mappings for getAllModels.
@@ -476,6 +487,7 @@ const MODEL_ENUMS = {
476
487
  [AIProviderName.LAYA]: LayaModels,
477
488
  [AIProviderName.XOR]: XorModels,
478
489
  [AIProviderName.PERPLEXITY_DECIDER]: PerplexityDeciderModels,
490
+ [AIProviderName.CLOUDFLARE_CLEF]: CloudflareClefModels,
479
491
  [AIProviderName.AUTO]: null,
480
492
  };
481
493
  /**
@@ -788,6 +788,18 @@ const PRICING = {
788
788
  _default: { input: 0.04 / 1_000_000, output: 0 },
789
789
  "pplx-decider-v1-27b": { input: 0.04 / 1_000_000, output: 0 },
790
790
  },
791
+ "cloudflare-clef": {
792
+ // Workers AI bills Clef per million INPUT tokens ($0.24 for clef, $0.09 for
793
+ // clef-flash); no output price is listed. `output: 0` is a price, not a token
794
+ // count, so do not "correct" it from `usage.output_tokens`. The `cf-ai-neurons`
795
+ // response header was checked against the published neuron rates on
796
+ // 2026-10-03 and matched them exactly (21,818 and 8,182 neurons per million
797
+ // input tokens). Rates from Cloudflare's Workers AI pricing page. An unknown
798
+ // model name is priced as clef, the dearer of the two.
799
+ _default: { input: 0.24 / 1_000_000, output: 0 },
800
+ clef: { input: 0.24 / 1_000_000, output: 0 },
801
+ "clef-flash": { input: 0.09 / 1_000_000, output: 0 },
802
+ },
791
803
  stability: {
792
804
  // Stability AI bills per image; symbolic per-token rate.
793
805
  _default: { input: 0, output: 0.04 / 1_000 },
@@ -416,3 +416,10 @@ export declare function createXorConfig(): ProviderConfigOptions;
416
416
  * provider and has a public endpoint, so the key alone configures it.
417
417
  */
418
418
  export declare function createPerplexityDeciderConfig(): ProviderConfigOptions;
419
+ /**
420
+ * Cloudflare Clef — the `decide` inference type, reached through Workers AI,
421
+ * not the Workers AI text models. It reads the same CLOUDFLARE_API_KEY and
422
+ * CLOUDFLARE_ACCOUNT_ID as the `cloudflare` text provider; the endpoint is
423
+ * Cloudflare's own, so the two together configure it.
424
+ */
425
+ export declare function createCloudflareClefConfig(): ProviderConfigOptions;
@@ -1376,3 +1376,22 @@ export function createPerplexityDeciderConfig() {
1376
1376
  ],
1377
1377
  };
1378
1378
  }
1379
+ /**
1380
+ * Cloudflare Clef — the `decide` inference type, reached through Workers AI,
1381
+ * not the Workers AI text models. It reads the same CLOUDFLARE_API_KEY and
1382
+ * CLOUDFLARE_ACCOUNT_ID as the `cloudflare` text provider; the endpoint is
1383
+ * Cloudflare's own, so the two together configure it.
1384
+ */
1385
+ export function createCloudflareClefConfig() {
1386
+ return {
1387
+ providerName: "Cloudflare Clef",
1388
+ envVarName: "CLOUDFLARE_API_KEY",
1389
+ setupUrl: "https://dash.cloudflare.com/profile/api-tokens",
1390
+ description: "API token (Workers AI scope) for Cloudflare's Clef decision models",
1391
+ instructions: [
1392
+ "1. Create an API token with the 'Workers AI: Read + Write' permission (https://dash.cloudflare.com/profile/api-tokens)",
1393
+ "2. Set CLOUDFLARE_API_KEY to it, and CLOUDFLARE_ACCOUNT_ID to your account id (in the dashboard URL, or under 'Account ID'); they are the same settings the Cloudflare text provider reads, so setting them also lets decide() use Clef when no other decision provider is configured",
1394
+ "3. The Clef endpoint ignores state text past about 2,048 tokens, so use it for short decisions",
1395
+ ],
1396
+ };
1397
+ }