@alfe.ai/gateway 0.0.29 → 0.0.31

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/health.js CHANGED
@@ -80,6 +80,7 @@ const ID_PREFIXES = {
80
80
  goal: "goal",
81
81
  memory: "mem",
82
82
  knowledgeTriple: "kgt",
83
+ accessCode: "acc",
83
84
  run: "run",
84
85
  request: "req",
85
86
  connection: "conn",
@@ -366,6 +367,15 @@ var AuthService = class {
366
367
  body: JSON.stringify(input)
367
368
  });
368
369
  }
370
+ getAccessStatus() {
371
+ return this.client.request(`${this.prefix}/access/status`);
372
+ }
373
+ redeemAccessCode(code) {
374
+ return this.client.request(`${this.prefix}/access/redeem`, {
375
+ method: "POST",
376
+ body: JSON.stringify({ code })
377
+ });
378
+ }
369
379
  getSubscriptionStatus() {
370
380
  return this.client.request(`${this.prefix}/subscription`);
371
381
  }
@@ -3220,6 +3230,12 @@ enumValues({
3220
3230
  enumValues({
3221
3231
  Anthropic: "anthropic",
3222
3232
  OpenAI: "openai",
3233
+ DeepSeek: "deepseek",
3234
+ Google: "google",
3235
+ MiniMax: "minimax",
3236
+ Mistral: "mistral",
3237
+ XAI: "xai",
3238
+ OpenRouter: "openrouter",
3223
3239
  ElevenLabs: "elevenlabs",
3224
3240
  Twilio: "twilio"
3225
3241
  });
@@ -3379,7 +3395,8 @@ enumValues({
3379
3395
  enumValues({
3380
3396
  User: "user",
3381
3397
  Agent: "agent",
3382
- Support: "support"
3398
+ Support: "support",
3399
+ Wizard: "wizard"
3383
3400
  });
3384
3401
  enumValues({
3385
3402
  Dev: "dev",
@@ -3397,15 +3414,74 @@ const ANTHROPIC_MODELS = enumValues(AnthropicModel);
3397
3414
  const OpenAIModel = {
3398
3415
  GPT4o: "gpt-4o",
3399
3416
  GPT4oMini: "gpt-4o-mini",
3400
- O3: "o3"
3417
+ O3: "o3",
3418
+ GPT41: "gpt-4.1",
3419
+ GPT41Mini: "gpt-4.1-mini",
3420
+ GPT41Nano: "gpt-4.1-nano",
3421
+ GPT54: "gpt-5.4",
3422
+ GPT54Mini: "gpt-5.4-mini",
3423
+ GPT54Nano: "gpt-5.4-nano",
3424
+ GPT54Pro: "gpt-5.4-pro",
3425
+ O3Mini: "o3-mini",
3426
+ O4Mini: "o4-mini"
3401
3427
  };
3402
3428
  const OPENAI_MODELS = enumValues(OpenAIModel);
3403
- [...ANTHROPIC_MODELS, ...OPENAI_MODELS];
3429
+ const DeepSeekModel = {
3430
+ Chat: "deepseek-chat",
3431
+ Reasoner: "deepseek-reasoner"
3432
+ };
3433
+ const DEEPSEEK_MODELS = enumValues(DeepSeekModel);
3434
+ const GoogleModel = {
3435
+ Gemini25Pro: "gemini-2.5-pro",
3436
+ Gemini25Flash: "gemini-2.5-flash",
3437
+ Gemini25FlashLite: "gemini-2.5-flash-lite",
3438
+ Gemini20Flash: "gemini-2.0-flash"
3439
+ };
3440
+ const GOOGLE_MODELS = enumValues(GoogleModel);
3441
+ const MiniMaxModel = {
3442
+ M27: "MiniMax-M2.7",
3443
+ M25: "MiniMax-M2.5"
3444
+ };
3445
+ const MINIMAX_MODELS = enumValues(MiniMaxModel);
3446
+ const MistralModel = {
3447
+ Large: "mistral-large-latest",
3448
+ Small: "mistral-small-latest",
3449
+ Codestral: "codestral-latest"
3450
+ };
3451
+ const MISTRAL_MODELS = enumValues(MistralModel);
3452
+ const XAIModel = {
3453
+ Grok4: "grok-4",
3454
+ Grok41Fast: "grok-4.1-fast"
3455
+ };
3456
+ const XAI_MODELS = enumValues(XAIModel);
3457
+ AnthropicModel.Sonnet;
3458
+ [
3459
+ ...ANTHROPIC_MODELS,
3460
+ ...OPENAI_MODELS,
3461
+ ...DEEPSEEK_MODELS,
3462
+ ...GOOGLE_MODELS,
3463
+ ...MINIMAX_MODELS,
3464
+ ...MISTRAL_MODELS,
3465
+ ...XAI_MODELS
3466
+ ];
3404
3467
  _enum(ANTHROPIC_MODELS);
3405
3468
  _enum(OPENAI_MODELS);
3406
- _enum([...ANTHROPIC_MODELS, ...OPENAI_MODELS]);
3407
- AnthropicModel.Opus, AnthropicModel.Sonnet, AnthropicModel.Haiku, OpenAIModel.GPT4o, OpenAIModel.GPT4oMini, OpenAIModel.O3;
3408
- AnthropicModel.Opus, AnthropicModel.Sonnet, AnthropicModel.Haiku, OpenAIModel.GPT4o, OpenAIModel.GPT4oMini, OpenAIModel.O3;
3469
+ _enum(DEEPSEEK_MODELS);
3470
+ _enum(GOOGLE_MODELS);
3471
+ _enum(MINIMAX_MODELS);
3472
+ _enum(MISTRAL_MODELS);
3473
+ _enum(XAI_MODELS);
3474
+ _enum([
3475
+ ...ANTHROPIC_MODELS,
3476
+ ...OPENAI_MODELS,
3477
+ ...DEEPSEEK_MODELS,
3478
+ ...GOOGLE_MODELS,
3479
+ ...MINIMAX_MODELS,
3480
+ ...MISTRAL_MODELS,
3481
+ ...XAI_MODELS
3482
+ ]);
3483
+ AnthropicModel.Opus, AnthropicModel.Sonnet, AnthropicModel.Haiku, OpenAIModel.GPT4o, OpenAIModel.GPT4oMini, OpenAIModel.O3, OpenAIModel.GPT41, OpenAIModel.GPT41Mini, OpenAIModel.GPT41Nano, OpenAIModel.GPT54, OpenAIModel.GPT54Mini, OpenAIModel.GPT54Nano, OpenAIModel.GPT54Pro, OpenAIModel.O3Mini, OpenAIModel.O4Mini, DeepSeekModel.Chat, DeepSeekModel.Reasoner, GoogleModel.Gemini25Pro, GoogleModel.Gemini25Flash, GoogleModel.Gemini25FlashLite, GoogleModel.Gemini20Flash, MiniMaxModel.M27, MiniMaxModel.M25, MistralModel.Large, MistralModel.Small, MistralModel.Codestral, XAIModel.Grok4, XAIModel.Grok41Fast;
3484
+ AnthropicModel.Opus, AnthropicModel.Sonnet, AnthropicModel.Haiku, OpenAIModel.GPT4o, OpenAIModel.GPT4oMini, OpenAIModel.O3, OpenAIModel.GPT41, OpenAIModel.GPT41Mini, OpenAIModel.GPT41Nano, OpenAIModel.GPT54, OpenAIModel.GPT54Mini, OpenAIModel.GPT54Nano, OpenAIModel.GPT54Pro, OpenAIModel.O3Mini, OpenAIModel.O4Mini, DeepSeekModel.Chat, DeepSeekModel.Reasoner, GoogleModel.Gemini25Pro, GoogleModel.Gemini25Flash, GoogleModel.Gemini25FlashLite, GoogleModel.Gemini20Flash, MiniMaxModel.M27, MiniMaxModel.M25, MistralModel.Large, MistralModel.Small, MistralModel.Codestral, XAIModel.Grok4, XAIModel.Grok41Fast;
3409
3485
  enumValues({
3410
3486
  PendingChallenge: "pending_challenge",
3411
3487
  Creating: "creating",
@@ -3668,10 +3744,15 @@ async function fetchAgentConfig(apiKey, apiEndpoint) {
3668
3744
  logger$1.debug({ status: wsResponse.status }, "Workspace config fetch failed");
3669
3745
  return null;
3670
3746
  }
3671
- const templateKey = (await wsResponse.json()).data?.templateKey;
3747
+ const wsResult = await wsResponse.json();
3748
+ const templateKey = wsResult.data?.templateKey;
3749
+ const defaultModel = wsResult.data?.defaultModel ?? void 0;
3672
3750
  if (!templateKey) {
3673
3751
  logger$1.debug("No templateKey in workspace response");
3674
- return null;
3752
+ return defaultModel ? {
3753
+ defaultModel,
3754
+ files: {}
3755
+ } : null;
3675
3756
  }
3676
3757
  logger$1.debug({ templateKey }, "Fetching template files...");
3677
3758
  const filesResponse = await fetch(`${apiEndpoint}/templates/${encodeURIComponent(templateKey)}/files`, {
@@ -3682,6 +3763,7 @@ async function fetchAgentConfig(apiKey, apiEndpoint) {
3682
3763
  logger$1.debug({ status: filesResponse.status }, "Template files fetch failed");
3683
3764
  return {
3684
3765
  templateKey,
3766
+ defaultModel,
3685
3767
  files: {}
3686
3768
  };
3687
3769
  }
@@ -3693,6 +3775,7 @@ async function fetchAgentConfig(apiKey, apiEndpoint) {
3693
3775
  }, "Template files fetched");
3694
3776
  return {
3695
3777
  templateKey,
3778
+ defaultModel,
3696
3779
  files: filesResult.data?.files ?? {}
3697
3780
  };
3698
3781
  } catch (err) {
@@ -19936,7 +20019,6 @@ function createLogger(component, additionalData) {
19936
20019
  const log$1 = createLogger("RuntimeProcess");
19937
20020
  const BACKOFF_INITIAL_MS = 1e3;
19938
20021
  const BACKOFF_MAX_MS = 3e4;
19939
- const STABLE_UPTIME_MS = 6e4;
19940
20022
  var RuntimeProcess = class {
19941
20023
  child = null;
19942
20024
  stopped = false;
@@ -20011,13 +20093,24 @@ var RuntimeProcess = class {
20011
20093
  }, "Runtime stopped (expected)");
20012
20094
  return;
20013
20095
  }
20096
+ if (code === 0 && signal == null) {
20097
+ log$1.info({
20098
+ runtime: this.options.runtime,
20099
+ code
20100
+ }, "Runtime exited gracefully — restarting");
20101
+ this.restartTimer = setTimeout(() => {
20102
+ this.restartTimer = null;
20103
+ this.start();
20104
+ }, 500);
20105
+ return;
20106
+ }
20014
20107
  log$1.warn({
20015
20108
  runtime: this.options.runtime,
20016
20109
  code,
20017
20110
  signal,
20018
20111
  backoffMs: this.backoffMs
20019
- }, "Runtime exited unexpectedly — scheduling restart");
20020
- if (Date.now() - this.lastStartTime >= STABLE_UPTIME_MS) this.backoffMs = BACKOFF_INITIAL_MS;
20112
+ }, "Runtime crashed — scheduling restart with backoff");
20113
+ if (Date.now() - this.lastStartTime >= 6e4) this.backoffMs = BACKOFF_INITIAL_MS;
20021
20114
  this.restartTimer = setTimeout(() => {
20022
20115
  this.restartTimer = null;
20023
20116
  this.start();
@@ -41,6 +41,7 @@ declare function startDaemon(): Promise<void>;
41
41
  */
42
42
  interface AgentWorkspaceConfig {
43
43
  templateKey?: string;
44
+ defaultModel?: string;
44
45
  files: Record<string, string>;
45
46
  }
46
47
  declare const ALFE_DIR: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/gateway",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "description": "Alfe local gateway daemon — persistent control plane for agent integrations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,10 +22,10 @@
22
22
  "pino-roll": "^1.2.0",
23
23
  "smol-toml": ">=1.6.1",
24
24
  "ws": "^8.18.0",
25
- "@alfe.ai/ai-proxy-local": "^0.0.5",
26
- "@alfe.ai/config": "^0.0.5",
25
+ "@alfe.ai/ai-proxy-local": "^0.0.6",
26
+ "@alfe.ai/config": "^0.0.6",
27
27
  "@alfe.ai/integration-manifest": "^0.0.8",
28
- "@alfe.ai/integrations": "^0.0.19"
28
+ "@alfe.ai/integrations": "^0.0.20"
29
29
  },
30
30
  "license": "UNLICENSED",
31
31
  "scripts": {