@borgee/agents-host 0.2.32 → 0.2.35

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 (42) hide show
  1. package/README.md +28 -7
  2. package/dist/agents-host.d.ts +17 -0
  3. package/dist/agents-host.js +52 -0
  4. package/dist/chat/chat-control-plane.d.ts +9 -0
  5. package/dist/chat/sdk-chat-control-plane.d.ts +11 -2
  6. package/dist/chat/sdk-chat-control-plane.js +7 -1
  7. package/dist/cli-args.d.ts +1 -1
  8. package/dist/cli-args.js +5 -0
  9. package/dist/compatibility-gates.d.ts +1 -0
  10. package/dist/compatibility-gates.js +2 -0
  11. package/dist/config.d.ts +4 -1
  12. package/dist/config.js +21 -3
  13. package/dist/context/main-session-delegation.d.ts +1 -0
  14. package/dist/context/main-session-delegation.js +6 -0
  15. package/dist/context/prompt.js +4 -2
  16. package/dist/durable-cursor-store.d.ts +1 -1
  17. package/dist/durable-cursor-store.js +1 -1
  18. package/dist/gateway/localhost-gateway.js +67 -1
  19. package/dist/local-config.js +10 -1
  20. package/dist/managed-daemon.js +5 -0
  21. package/dist/plugin-sdk.js +5188 -0
  22. package/dist/plugin-sdk.js.map +7 -0
  23. package/dist/policy/gateway-authorization.d.ts +18 -3
  24. package/dist/policy/gateway-authorization.js +33 -1
  25. package/dist/providers/claude/adapter.js +3 -1
  26. package/dist/providers/claude/cli-client.d.ts +25 -1
  27. package/dist/providers/claude/cli-client.js +127 -10
  28. package/dist/providers/codex/adapter.js +3 -1
  29. package/dist/providers/codex/cli-client.d.ts +25 -1
  30. package/dist/providers/codex/cli-client.js +127 -10
  31. package/dist/providers/codex/project-doc.js +3 -0
  32. package/dist/providers/copilot/adapter.js +3 -1
  33. package/dist/providers/copilot/cli-client.d.ts +25 -1
  34. package/dist/providers/copilot/cli-client.js +125 -10
  35. package/dist/providers/create-provider.js +14 -9
  36. package/dist/providers/idle-backend-shutdown.d.ts +16 -0
  37. package/dist/providers/idle-backend-shutdown.js +53 -0
  38. package/dist/types.d.ts +7 -0
  39. package/package.json +6 -5
  40. package/skills/borgee-agent/SKILL.md +19 -2
  41. package/skills/borgee-agent/borgee-agent.mjs +56 -1
  42. package/skills/borgee-agent/borgee-agent.py +33 -2
@@ -2,7 +2,7 @@ import { promises as fs } from 'node:fs';
2
2
  import { randomUUID } from 'node:crypto';
3
3
  import { dirname, extname, isAbsolute, join, relative, resolve } from 'node:path';
4
4
  import { parseDocument, stringify } from 'yaml';
5
- import { assertProviderCompatibility, assertProviderCommandCompatibility, optionalNonEmptyString, optionalStringArray, parseCopilotSessionTtlMinutesValue, requireNonEmptyString, resolveProvider, resolveProviderCommandConfig, } from './config.js';
5
+ import { assertProviderCompatibility, assertProviderCommandCompatibility, optionalNonEmptyString, optionalStringArray, parseCopilotSessionTtlMinutesValue, parseProviderIdleShutdownMinutesValue, requireNonEmptyString, resolveProvider, resolveProviderCommandConfig, } from './config.js';
6
6
  import { resolveLocalConfigAgentStateRoot } from './state-paths.js';
7
7
  const SUPPORTED_CONFIG_EXTENSIONS = new Set(['.json', '.yaml', '.yml']);
8
8
  export const DEFAULT_LOCAL_HOST_CONFIG_FILENAME = 'agents-host.yaml';
@@ -124,6 +124,9 @@ function parseProviderCommandOverrides(value, sourceLabel) {
124
124
  if (value.copilotSessionTtlMinutes !== undefined && value.copilotSessionTtlMinutes !== null) {
125
125
  overrides.copilotSessionTtlMinutes = parseCopilotSessionTtlMinutesValue(value.copilotSessionTtlMinutes, sourceLabel);
126
126
  }
127
+ if (value.providerIdleShutdownMinutes !== undefined && value.providerIdleShutdownMinutes !== null) {
128
+ overrides.providerIdleShutdownMinutes = parseProviderIdleShutdownMinutesValue(value.providerIdleShutdownMinutes, sourceLabel);
129
+ }
127
130
  return overrides;
128
131
  }
129
132
  function toAgentsDir(hostConfigPath, rawAgentsDir) {
@@ -593,6 +596,9 @@ function renderAgentConfigYaml(agent) {
593
596
  if (agent.copilotSessionTtlMinutes !== undefined) {
594
597
  config.copilotSessionTtlMinutes = agent.copilotSessionTtlMinutes;
595
598
  }
599
+ if (agent.providerIdleShutdownMinutes !== undefined) {
600
+ config.providerIdleShutdownMinutes = agent.providerIdleShutdownMinutes;
601
+ }
596
602
  return stringify(config);
597
603
  }
598
604
  function buildManagedAgentSnapshot(host, stateRootBaseDir, sourcePath, agent) {
@@ -629,6 +635,9 @@ function resolveAgentProviderCommandConfig(hostDefaults, agent) {
629
635
  ...(agent.copilotSessionTtlMinutes !== undefined
630
636
  ? { copilotSessionTtlMinutes: agent.copilotSessionTtlMinutes }
631
637
  : {}),
638
+ ...(agent.providerIdleShutdownMinutes !== undefined
639
+ ? { providerIdleShutdownMinutes: agent.providerIdleShutdownMinutes }
640
+ : {}),
632
641
  });
633
642
  }
634
643
  export async function loadLocalConfigSnapshot(hostConfigPath, deps = {}) {
@@ -339,6 +339,7 @@ export function buildManagedLocalAgentConfig(options) {
339
339
  copilotCommand: config.copilotCommand,
340
340
  copilotArgs: [...config.copilotArgs],
341
341
  copilotSessionTtlMinutes: config.copilotSessionTtlMinutes,
342
+ providerIdleShutdownMinutes: config.providerIdleShutdownMinutes,
342
343
  },
343
344
  };
344
345
  }
@@ -382,6 +383,9 @@ function mergeManagedLocalAgentConfig(hostDefaults, existingAgent, generatedAgen
382
383
  copilotSessionTtlMinutes: hasOverride('COPILOT_SESSION_TTL_MINUTES')
383
384
  ? generatedAgent.copilotSessionTtlMinutes
384
385
  : existingAgent.copilotSessionTtlMinutes,
386
+ providerIdleShutdownMinutes: hasOverride('PROVIDER_IDLE_SHUTDOWN_MINUTES')
387
+ ? generatedAgent.providerIdleShutdownMinutes
388
+ : existingAgent.providerIdleShutdownMinutes,
385
389
  };
386
390
  }
387
391
  function collectExplicitManagedAgentEnvOverrides(processEnv, optionEnv) {
@@ -396,6 +400,7 @@ function collectExplicitManagedAgentEnvOverrides(processEnv, optionEnv) {
396
400
  'COPILOT_COMMAND',
397
401
  'COPILOT_ARGS',
398
402
  'COPILOT_SESSION_TTL_MINUTES',
403
+ 'PROVIDER_IDLE_SHUTDOWN_MINUTES',
399
404
  ]) {
400
405
  if (processEnv[key] !== undefined) {
401
406
  explicitOverrides[key] = processEnv[key];