veryfront 0.0.74 → 0.0.75

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/dist/ai/index.js CHANGED
@@ -138,11 +138,11 @@ var ConsoleLogger = class _ConsoleLogger {
138
138
  this.prefix = prefix;
139
139
  this.level = level;
140
140
  this.format = format;
141
- this.boundContext = {};
142
141
  if (boundContext) {
143
142
  this.boundContext = boundContext;
144
143
  }
145
144
  }
145
+ boundContext = {};
146
146
  setLevel(level) {
147
147
  this.level = level;
148
148
  }
@@ -318,6 +318,7 @@ var OpenAICompletionResponseSchema = z.object({
318
318
  }).optional()
319
319
  });
320
320
  var BaseProvider = class {
321
+ config;
321
322
  constructor(config) {
322
323
  this.config = config;
323
324
  this.validateConfig();
@@ -542,9 +543,12 @@ var OpenAIResponseSchema = z2.object({
542
543
  }).optional()
543
544
  });
544
545
  var OpenAIProvider = class extends BaseProvider {
546
+ name = "openai";
547
+ apiKey;
548
+ baseURL;
549
+ organizationId;
545
550
  constructor(config) {
546
551
  super(config);
547
- this.name = "openai";
548
552
  this.apiKey = config.apiKey;
549
553
  this.baseURL = config.baseURL || "https://api.openai.com/v1";
550
554
  this.organizationId = config.organizationId;
@@ -647,9 +651,11 @@ var OpenAIProvider = class extends BaseProvider {
647
651
 
648
652
  // src/ai/providers/anthropic.ts
649
653
  var AnthropicProvider = class extends BaseProvider {
654
+ name = "anthropic";
655
+ apiKey;
656
+ baseURL;
650
657
  constructor(config) {
651
658
  super(config);
652
- this.name = "anthropic";
653
659
  this.apiKey = config.apiKey;
654
660
  this.baseURL = config.baseURL || "https://api.anthropic.com";
655
661
  }
@@ -947,9 +953,11 @@ var GoogleResponseSchema = z3.object({
947
953
  }).optional()
948
954
  });
949
955
  var GoogleProvider = class extends BaseProvider {
956
+ name = "google";
957
+ apiKey;
958
+ baseURL;
950
959
  constructor(config) {
951
960
  super(config);
952
- this.name = "google";
953
961
  this.apiKey = config.apiKey;
954
962
  this.baseURL = config.baseURL || "https://generativelanguage.googleapis.com/v1beta";
955
963
  }
@@ -1071,11 +1079,9 @@ function getEnv(key) {
1071
1079
 
1072
1080
  // src/ai/providers/factory.ts
1073
1081
  var ProviderRegistry = class {
1074
- constructor() {
1075
- this.providers = /* @__PURE__ */ new Map();
1076
- this.config = {};
1077
- this.autoInitialized = false;
1078
- }
1082
+ providers = /* @__PURE__ */ new Map();
1083
+ config = {};
1084
+ autoInitialized = false;
1079
1085
  /**
1080
1086
  * Auto-initialize providers from environment variables
1081
1087
  * This is called lazily when a provider is first requested
@@ -1499,9 +1505,7 @@ function generateToolId() {
1499
1505
  return `tool_${Date.now()}_${toolIdCounter++}`;
1500
1506
  }
1501
1507
  var ToolRegistryClass = class {
1502
- constructor() {
1503
- this.tools = /* @__PURE__ */ new Map();
1504
- }
1508
+ tools = /* @__PURE__ */ new Map();
1505
1509
  register(id, toolInstance) {
1506
1510
  if (this.tools.has(id)) {
1507
1511
  agentLogger.debug(`Tool "${id}" is already registered. Overwriting.`);
@@ -1761,9 +1765,7 @@ function patternToId(pattern) {
1761
1765
  return pattern.replace(/^\//, "").replace(/\//g, "_").replace(/:/g, "");
1762
1766
  }
1763
1767
  var ResourceRegistryClass = class {
1764
- constructor() {
1765
- this.resources = /* @__PURE__ */ new Map();
1766
- }
1768
+ resources = /* @__PURE__ */ new Map();
1767
1769
  /**
1768
1770
  * Register a resource
1769
1771
  */
@@ -1859,9 +1861,7 @@ function interpolateVariables(template, variables) {
1859
1861
  });
1860
1862
  }
1861
1863
  var PromptRegistryClass = class {
1862
- constructor() {
1863
- this.prompts = /* @__PURE__ */ new Map();
1864
- }
1864
+ prompts = /* @__PURE__ */ new Map();
1865
1865
  /**
1866
1866
  * Register a prompt
1867
1867
  */
@@ -1992,9 +1992,7 @@ function createWorkflow(config) {
1992
1992
  };
1993
1993
  }
1994
1994
  var AgentRegistryClass = class {
1995
- constructor() {
1996
- this.agents = /* @__PURE__ */ new Map();
1997
- }
1995
+ agents = /* @__PURE__ */ new Map();
1998
1996
  /**
1999
1997
  * Register an agent
2000
1998
  */
@@ -2255,7 +2253,7 @@ import { dirname, join } from "node:path";
2255
2253
  // deno.json
2256
2254
  var deno_default = {
2257
2255
  name: "veryfront",
2258
- version: "0.0.74",
2256
+ version: "0.0.75",
2259
2257
  nodeModulesDir: "auto",
2260
2258
  exclude: [
2261
2259
  "npm/",
@@ -2287,7 +2285,11 @@ var deno_default = {
2287
2285
  "./oauth": "./src/core/oauth/index.ts",
2288
2286
  "./oauth/providers": "./src/core/oauth/providers/index.ts",
2289
2287
  "./oauth/handlers": "./src/core/oauth/handlers/index.ts",
2290
- "./oauth/token-store": "./src/core/oauth/token-store/index.ts"
2288
+ "./oauth/token-store": "./src/core/oauth/token-store/index.ts",
2289
+ "./head": "./src/exports/head.ts",
2290
+ "./router": "./src/exports/router.ts",
2291
+ "./context": "./src/exports/context.ts",
2292
+ "./fonts": "./src/exports/fonts.ts"
2291
2293
  },
2292
2294
  imports: {
2293
2295
  "@veryfront": "./src/index.ts",
@@ -2342,7 +2344,7 @@ var deno_default = {
2342
2344
  "@types/react-dom": "https://esm.sh/@types/react-dom@18.3.7?deps=csstype@3.2.3",
2343
2345
  react: "npm:react@18.3.1",
2344
2346
  "react-dom": "npm:react-dom@18.3.1",
2345
- "react-dom/server": "npm:react-dom@18.3.1/server.node",
2347
+ "react-dom/server": "npm:react-dom@18.3.1/server",
2346
2348
  "react-dom/client": "npm:react-dom@18.3.1/client",
2347
2349
  "react/jsx-runtime": "npm:react@18.3.1/jsx-runtime",
2348
2350
  "react/jsx-dev-runtime": "npm:react@18.3.1/jsx-dev-runtime",
@@ -2372,7 +2374,7 @@ var deno_default = {
2372
2374
  unocss: "https://esm.sh/unocss@0.59.0",
2373
2375
  "@unocss/core": "https://esm.sh/@unocss/core@0.59.0",
2374
2376
  "@unocss/preset-wind": "https://esm.sh/@unocss/preset-wind@0.59.0",
2375
- "next-themes": "npm:next-themes@0.3.0",
2377
+ "next-themes": "npm:next-themes@0.4",
2376
2378
  redis: "npm:redis",
2377
2379
  pg: "npm:pg",
2378
2380
  "@opentelemetry/api": "npm:@opentelemetry/api@1",
@@ -2589,12 +2591,10 @@ var DEV_SERVER_ENDPOINTS = {
2589
2591
 
2590
2592
  // src/platform/compat/fs.ts
2591
2593
  var NodeFileSystem = class {
2592
- constructor() {
2593
- this.fs = null;
2594
- this.os = null;
2595
- this.path = null;
2596
- this.initialized = false;
2597
- }
2594
+ fs = null;
2595
+ os = null;
2596
+ path = null;
2597
+ initialized = false;
2598
2598
  async ensureInitialized() {
2599
2599
  if (this.initialized)
2600
2600
  return;
@@ -2886,7 +2886,7 @@ var ConfigValidationError = class extends Error {
2886
2886
  function isVirtualFilesystem(adapter) {
2887
2887
  const wrappedAdapter = adapter?.fs?.fsAdapter;
2888
2888
  const adapterName = wrappedAdapter?.constructor?.name;
2889
- return adapterName === "VeryfrontFSAdapter";
2889
+ return adapterName === "VeryfrontFSAdapter" || adapterName === "MultiProjectFSAdapter";
2890
2890
  }
2891
2891
  async function loadConfigFromVirtualFS(configPath, projectDir, adapter) {
2892
2892
  const fs2 = createFileSystem();
@@ -3735,8 +3735,9 @@ function generateId(prefix) {
3735
3735
 
3736
3736
  // src/ai/agent/memory.ts
3737
3737
  var ConversationMemory = class {
3738
+ messages = [];
3739
+ config;
3738
3740
  constructor(config) {
3739
- this.messages = [];
3740
3741
  this.config = config;
3741
3742
  }
3742
3743
  async add(message) {
@@ -3781,8 +3782,10 @@ var ConversationMemory = class {
3781
3782
  }
3782
3783
  };
3783
3784
  var BufferMemory = class {
3785
+ messages = [];
3786
+ config;
3787
+ bufferSize;
3784
3788
  constructor(config) {
3785
- this.messages = [];
3786
3789
  this.config = config;
3787
3790
  this.bufferSize = config.maxMessages || 10;
3788
3791
  }
@@ -3816,9 +3819,11 @@ var BufferMemory = class {
3816
3819
  }
3817
3820
  };
3818
3821
  var SummaryMemory = class {
3822
+ messages = [];
3823
+ summary = "";
3824
+ config;
3825
+ summaryThreshold;
3819
3826
  constructor(config) {
3820
- this.messages = [];
3821
- this.summary = "";
3822
3827
  this.config = config;
3823
3828
  this.summaryThreshold = config.maxMessages || 20;
3824
3829
  }
@@ -3927,11 +3932,9 @@ var VERYFRONT_PATHS = {
3927
3932
 
3928
3933
  // src/core/utils/bundle-manifest.ts
3929
3934
  var InMemoryBundleManifestStore = class {
3930
- constructor() {
3931
- this.metadata = /* @__PURE__ */ new Map();
3932
- this.code = /* @__PURE__ */ new Map();
3933
- this.sourceIndex = /* @__PURE__ */ new Map();
3934
- }
3935
+ metadata = /* @__PURE__ */ new Map();
3936
+ code = /* @__PURE__ */ new Map();
3937
+ sourceIndex = /* @__PURE__ */ new Map();
3935
3938
  getBundleMetadata(key) {
3936
3939
  const entry = this.metadata.get(key);
3937
3940
  if (!entry)
@@ -4226,16 +4229,14 @@ var ContextPropagation = class {
4226
4229
 
4227
4230
  // src/observability/tracing/manager.ts
4228
4231
  var TracingManager = class {
4229
- constructor() {
4230
- this.state = {
4231
- initialized: false,
4232
- tracer: null,
4233
- api: null,
4234
- propagator: null
4235
- };
4236
- this.spanOps = null;
4237
- this.contextProp = null;
4238
- }
4232
+ state = {
4233
+ initialized: false,
4234
+ tracer: null,
4235
+ api: null,
4236
+ propagator: null
4237
+ };
4238
+ spanOps = null;
4239
+ contextProp = null;
4239
4240
  async initialize(config = {}, adapter) {
4240
4241
  if (this.state.initialized) {
4241
4242
  serverLogger.debug("[tracing] Already initialized");
@@ -4418,8 +4419,11 @@ var DEFAULT_MAX_TOKENS = AGENT_DEFAULTS.maxTokens;
4418
4419
  var DEFAULT_TEMPERATURE = AGENT_DEFAULTS.temperature;
4419
4420
  var MAX_STREAM_BUFFER_SIZE = STREAMING_DEFAULTS.maxBufferSize;
4420
4421
  var AgentRuntime = class {
4422
+ id;
4423
+ config;
4424
+ memory;
4425
+ status = "idle";
4421
4426
  constructor(id, config) {
4422
- this.status = "idle";
4423
4427
  this.id = id;
4424
4428
  this.config = config;
4425
4429
  const memoryConfig = config.memory || { type: "conversation", maxTokens: 4e3 };
@@ -5407,6 +5411,7 @@ async function setupAI(options = {}) {
5407
5411
 
5408
5412
  // src/ai/mcp/server.ts
5409
5413
  var MCPServer = class {
5414
+ config;
5410
5415
  constructor(config) {
5411
5416
  this.config = config;
5412
5417
  }
@@ -5717,8 +5722,9 @@ import { anthropic } from "@ai-sdk/anthropic";
5717
5722
 
5718
5723
  // src/ai/production/rate-limit/limiter.ts
5719
5724
  var FixedWindowLimiter = class {
5725
+ requests = /* @__PURE__ */ new Map();
5726
+ config;
5720
5727
  constructor(config) {
5721
- this.requests = /* @__PURE__ */ new Map();
5722
5728
  this.config = config;
5723
5729
  }
5724
5730
  check(identifier) {
@@ -5759,8 +5765,10 @@ var FixedWindowLimiter = class {
5759
5765
  }
5760
5766
  };
5761
5767
  var TokenBucketLimiter = class {
5768
+ buckets = /* @__PURE__ */ new Map();
5769
+ config;
5770
+ refillRate;
5762
5771
  constructor(config) {
5763
- this.buckets = /* @__PURE__ */ new Map();
5764
5772
  this.config = config;
5765
5773
  this.refillRate = config.maxRequests / config.windowMs;
5766
5774
  }
@@ -5863,9 +5871,7 @@ function rateLimitMiddleware(config) {
5863
5871
 
5864
5872
  // src/ai/production/cache/cache.ts
5865
5873
  var MemoryCache = class {
5866
- constructor() {
5867
- this.cache = /* @__PURE__ */ new Map();
5868
- }
5874
+ cache = /* @__PURE__ */ new Map();
5869
5875
  set(key, response) {
5870
5876
  this.cache.set(key, {
5871
5877
  response,
@@ -5896,8 +5902,9 @@ var MemoryCache = class {
5896
5902
  }
5897
5903
  };
5898
5904
  var LRUCache = class {
5905
+ cache = /* @__PURE__ */ new Map();
5906
+ maxSize;
5899
5907
  constructor(maxSize = 100) {
5900
- this.cache = /* @__PURE__ */ new Map();
5901
5908
  this.maxSize = maxSize;
5902
5909
  }
5903
5910
  set(key, response) {
@@ -5941,9 +5948,10 @@ var LRUCache = class {
5941
5948
  }
5942
5949
  };
5943
5950
  var TTLCache = class {
5951
+ cache = /* @__PURE__ */ new Map();
5952
+ ttl;
5953
+ cleanupInterval = null;
5944
5954
  constructor(ttl = 3e5) {
5945
- this.cache = /* @__PURE__ */ new Map();
5946
- this.cleanupInterval = null;
5947
5955
  this.ttl = ttl;
5948
5956
  this.startCleanup();
5949
5957
  }
@@ -6097,13 +6105,14 @@ function cacheMiddleware(config) {
6097
6105
 
6098
6106
  // src/ai/production/cost-tracking/tracker.ts
6099
6107
  var CostTracker = class {
6108
+ records = [];
6109
+ config;
6110
+ dailyTotal = 0;
6111
+ monthlyTotal = 0;
6112
+ lastDayReset = Date.now();
6113
+ lastMonthReset = Date.now();
6114
+ resetInterval = null;
6100
6115
  constructor(config) {
6101
- this.records = [];
6102
- this.dailyTotal = 0;
6103
- this.monthlyTotal = 0;
6104
- this.lastDayReset = Date.now();
6105
- this.lastMonthReset = Date.now();
6106
- this.resetInterval = null;
6107
6116
  this.config = config;
6108
6117
  this.startPeriodicReset();
6109
6118
  }
@@ -6366,6 +6375,7 @@ var PII_PATTERNS = {
6366
6375
  creditCard: /\b\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}\b/g
6367
6376
  };
6368
6377
  var InputValidator = class {
6378
+ config;
6369
6379
  constructor(config) {
6370
6380
  this.config = config || {};
6371
6381
  }
@@ -6425,6 +6435,7 @@ var InputValidator = class {
6425
6435
  }
6426
6436
  };
6427
6437
  var OutputFilter = class {
6438
+ config;
6428
6439
  constructor(config) {
6429
6440
  this.config = config || {};
6430
6441
  }
@@ -6698,12 +6709,13 @@ function hasLockSupport(backend) {
6698
6709
  // src/ai/workflow/backends/memory.ts
6699
6710
  var DEFAULT_MAX_QUEUE_SIZE = 1e4;
6700
6711
  var MemoryBackend = class {
6712
+ runs = /* @__PURE__ */ new Map();
6713
+ checkpoints = /* @__PURE__ */ new Map();
6714
+ approvals = /* @__PURE__ */ new Map();
6715
+ queue = [];
6716
+ locks = /* @__PURE__ */ new Map();
6717
+ config;
6701
6718
  constructor(config = {}) {
6702
- this.runs = /* @__PURE__ */ new Map();
6703
- this.checkpoints = /* @__PURE__ */ new Map();
6704
- this.approvals = /* @__PURE__ */ new Map();
6705
- this.queue = [];
6706
- this.locks = /* @__PURE__ */ new Map();
6707
6719
  this.config = {
6708
6720
  prefix: "wf:",
6709
6721
  debug: false,
@@ -7034,6 +7046,7 @@ var MemoryBackend = class {
7034
7046
 
7035
7047
  // src/ai/workflow/executor/dag-executor.ts
7036
7048
  var DAGExecutor = class {
7049
+ config;
7037
7050
  constructor(config) {
7038
7051
  this.config = {
7039
7052
  maxConcurrency: 10,
@@ -7731,6 +7744,7 @@ var DAGExecutor = class {
7731
7744
 
7732
7745
  // src/ai/workflow/executor/checkpoint-manager.ts
7733
7746
  var CheckpointManager = class {
7747
+ config;
7734
7748
  constructor(config) {
7735
7749
  this.config = {
7736
7750
  debug: false,
@@ -7894,6 +7908,7 @@ var DEFAULT_RETRY = {
7894
7908
  };
7895
7909
  var DEFAULT_STEP_TIMEOUT_MS = 5 * 60 * 1e3;
7896
7910
  var StepExecutor = class {
7911
+ config;
7897
7912
  constructor(config = {}) {
7898
7913
  this.config = {
7899
7914
  defaultTimeout: DEFAULT_STEP_TIMEOUT_MS,
@@ -8181,8 +8196,15 @@ var StepExecutor = class {
8181
8196
 
8182
8197
  // src/ai/workflow/executor/workflow-executor.ts
8183
8198
  var WorkflowExecutor = class _WorkflowExecutor {
8199
+ config;
8200
+ stepExecutor;
8201
+ checkpointManager;
8202
+ dagExecutor;
8203
+ workflows = /* @__PURE__ */ new Map();
8204
+ blobResolver;
8205
+ /** Default lock duration: 30 seconds */
8206
+ static DEFAULT_LOCK_DURATION = 3e4;
8184
8207
  constructor(config) {
8185
- this.workflows = /* @__PURE__ */ new Map();
8186
8208
  this.config = {
8187
8209
  maxConcurrency: 10,
8188
8210
  debug: false,
@@ -8218,10 +8240,6 @@ var WorkflowExecutor = class _WorkflowExecutor {
8218
8240
  };
8219
8241
  }
8220
8242
  }
8221
- static {
8222
- /** Default lock duration: 30 seconds */
8223
- this.DEFAULT_LOCK_DURATION = 3e4;
8224
- }
8225
8243
  /**
8226
8244
  * Register a workflow definition
8227
8245
  */
@@ -8576,8 +8594,10 @@ var WorkflowExecutor = class _WorkflowExecutor {
8576
8594
 
8577
8595
  // src/ai/workflow/runtime/approval-manager.ts
8578
8596
  var ApprovalManager = class {
8597
+ config;
8598
+ expirationTimer;
8599
+ destroyed = false;
8579
8600
  constructor(config) {
8580
- this.destroyed = false;
8581
8601
  this.config = {
8582
8602
  expirationCheckInterval: 6e4,
8583
8603
  // Check every minute
@@ -8804,6 +8824,10 @@ var ApprovalManager = class {
8804
8824
 
8805
8825
  // src/ai/workflow/api/workflow-client.ts
8806
8826
  var WorkflowClient = class {
8827
+ backend;
8828
+ executor;
8829
+ approvalManager;
8830
+ debug;
8807
8831
  constructor(config = {}) {
8808
8832
  this.debug = config.debug ?? false;
8809
8833
  this.backend = config.backend ?? new MemoryBackend({ debug: this.debug });