botinabox 0.5.7 → 0.6.0
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/index.d.ts +2 -20
- package/dist/index.js +0 -35
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -305,7 +305,6 @@ declare const EVENTS: {
|
|
|
305
305
|
declare const DEFAULTS: {
|
|
306
306
|
readonly TASK_POLL_INTERVAL_MS: 30000;
|
|
307
307
|
readonly NOTIFICATION_POLL_INTERVAL_MS: 5000;
|
|
308
|
-
readonly HEARTBEAT_INTERVAL_MS: 300000;
|
|
309
308
|
readonly ORPHAN_REAP_INTERVAL_MS: 300000;
|
|
310
309
|
readonly STALE_RUN_THRESHOLD_MS: 1800000;
|
|
311
310
|
readonly STALE_TASK_AGE_MS: 7200000;
|
|
@@ -1320,23 +1319,6 @@ declare class NdjsonLogger {
|
|
|
1320
1319
|
close(): void;
|
|
1321
1320
|
}
|
|
1322
1321
|
|
|
1323
|
-
/**
|
|
1324
|
-
* @deprecated Use {@link Scheduler} from `botinabox` instead.
|
|
1325
|
-
* HeartbeatScheduler uses in-memory setInterval which loses state on restart.
|
|
1326
|
-
* The Scheduler class uses database-backed schedules with cron expressions.
|
|
1327
|
-
*/
|
|
1328
|
-
declare class HeartbeatScheduler {
|
|
1329
|
-
private wakeupQueue;
|
|
1330
|
-
private hooks;
|
|
1331
|
-
private timers;
|
|
1332
|
-
constructor(wakeupQueue: WakeupQueue, hooks: HookBus);
|
|
1333
|
-
start(agents: Array<{
|
|
1334
|
-
id: string;
|
|
1335
|
-
heartbeat_config: string;
|
|
1336
|
-
}>): void;
|
|
1337
|
-
stop(): void;
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
1322
|
/**
|
|
1341
1323
|
* Scheduler — database-backed job scheduling with cron expressions.
|
|
1342
1324
|
*
|
|
@@ -1344,7 +1326,7 @@ declare class HeartbeatScheduler {
|
|
|
1344
1326
|
* it emits the schedule's `action` as a hook event with the
|
|
1345
1327
|
* `action_config` payload. Consumers subscribe to handle the action.
|
|
1346
1328
|
*
|
|
1347
|
-
*
|
|
1329
|
+
* Supports one-time and recurring use cases.
|
|
1348
1330
|
*/
|
|
1349
1331
|
|
|
1350
1332
|
interface ScheduleDef {
|
|
@@ -1567,4 +1549,4 @@ declare function isLoginRequired(stdout: string): boolean;
|
|
|
1567
1549
|
/** Rewrite local image paths to prevent CLI auto-embedding as vision content. */
|
|
1568
1550
|
declare function deactivateLocalImagePaths(prompt: string): string;
|
|
1569
1551
|
|
|
1570
|
-
export { AGENT_STATUSES, type AgentConfig, type AgentDefinition, type AgentFilter, type AgentRecord, AgentRegistry, type AgentStatus, ApiExecutionAdapter, AuditEmitter, type AuditEvent, BackupManager, type BotConfig, type BudgetCheck, type BudgetConfig, BudgetController, CORE_MIGRATIONS, ChannelAdapter, ChannelRegistry, ChannelRegistryError, ChatMessage, ChatSessionManager, CliExecutionAdapter, type ColumnValidator, ColumnValidatorImpl, type ConfigLoadError, type ConfigLoadResult, ConnectorConfig, DEFAULTS, DEFAULT_CONFIG, type DataConfig, DataStore, DataStoreError, type DomainEntityContextOptions, type DomainSchemaOptions, EVENTS, type EntityColumnDef, type EntityConfig, type EntityContextDef, type EntityFileSpec, type EntitySource, type ExecutionAdapter, type Filter, HealthStatus,
|
|
1552
|
+
export { AGENT_STATUSES, type AgentConfig, type AgentDefinition, type AgentFilter, type AgentRecord, AgentRegistry, type AgentStatus, ApiExecutionAdapter, AuditEmitter, type AuditEvent, BackupManager, type BotConfig, type BudgetCheck, type BudgetConfig, BudgetController, CORE_MIGRATIONS, ChannelAdapter, ChannelRegistry, ChannelRegistryError, ChatMessage, ChatSessionManager, CliExecutionAdapter, type ColumnValidator, ColumnValidatorImpl, type ConfigLoadError, type ConfigLoadResult, ConnectorConfig, DEFAULTS, DEFAULT_CONFIG, type DataConfig, DataStore, DataStoreError, type DomainEntityContextOptions, type DomainSchemaOptions, EVENTS, type EntityColumnDef, type EntityConfig, type EntityContextDef, type EntityFileSpec, type EntitySource, type ExecutionAdapter, type Filter, HealthStatus, HookBus, type HookHandler, type HookOptions, type HookRegistration, InboundMessage, LLMProvider, MAX_CHAIN_DEPTH, MessagePipeline, type ModelConfig, ModelInfo, ModelRouter, NdjsonLogger, NotificationQueue, type PackageMigration, type PackageUpdate, type ParsedStream, type PkLookup, ProviderRegistry, type QueryOptions, RUN_STATUSES, type RelationDef, type RenderConfig, ResolvedModel, type RetryPolicy, type Row, type RunContext, RunManager, type RunResult, type RunStatus, type SanitizerOptions, type Schedule, type ScheduleDef, Scheduler, type SchemaError, type SecretInput, type SecretMeta, SecretStore, type SecurityConfig, type SeedItem, SessionKey, SessionManager, type SqliteAdapter, type StepRef, TASK_STATUSES, type TableDefinition, type TableInfoRow, type TaskDefinition, TaskQueue, type TaskRecord, type TaskStatus, TokenUsage, type Unsubscribe, UpdateChecker, type UpdateConfig, UpdateManager, type UpdateManifest, type UsageSummary, type User, type UserInput, UserRegistry, WakeupQueue, type WorkflowConfigEntry, type WorkflowDefinition$1 as WorkflowDefinition, WorkflowEngine, type WorkflowRunRecord, type WorkflowRunStatus, type WorkflowStep$1 as WorkflowStep, type WorkflowStepConfig, type WorkflowTrigger, _resetConfig, areDependenciesMet, buildAgentBindings, buildChainOrigin, buildProcessEnv, checkAllowlist, checkChainDepth, checkMentionGate, chunkText, classifyUpdate, compareVersions, createConfigRevision, deactivateLocalImagePaths, defineCoreEntityContexts, defineCoreTables, defineDomainEntityContexts, defineDomainTables, detectCycle, discoverChannels, discoverProviders, formatText, getConfig, initConfig, interpolate, interpolateEnv, isLoginRequired, isMaxTurns, loadConfig, parseClaudeStream, parseVersion, runPackageMigrations, sanitize, topologicalSort, validateConfig };
|
package/dist/index.js
CHANGED
|
@@ -35,8 +35,6 @@ var EVENTS = {
|
|
|
35
35
|
var DEFAULTS = {
|
|
36
36
|
TASK_POLL_INTERVAL_MS: 3e4,
|
|
37
37
|
NOTIFICATION_POLL_INTERVAL_MS: 5e3,
|
|
38
|
-
HEARTBEAT_INTERVAL_MS: 3e5,
|
|
39
|
-
// 5 minutes
|
|
40
38
|
ORPHAN_REAP_INTERVAL_MS: 3e5,
|
|
41
39
|
// 5 minutes
|
|
42
40
|
STALE_RUN_THRESHOLD_MS: 18e5,
|
|
@@ -3408,38 +3406,6 @@ var NdjsonLogger = class {
|
|
|
3408
3406
|
}
|
|
3409
3407
|
};
|
|
3410
3408
|
|
|
3411
|
-
// src/core/orchestrator/heartbeat-scheduler.ts
|
|
3412
|
-
var HeartbeatScheduler = class {
|
|
3413
|
-
constructor(wakeupQueue, hooks) {
|
|
3414
|
-
this.wakeupQueue = wakeupQueue;
|
|
3415
|
-
this.hooks = hooks;
|
|
3416
|
-
}
|
|
3417
|
-
wakeupQueue;
|
|
3418
|
-
hooks;
|
|
3419
|
-
timers = /* @__PURE__ */ new Map();
|
|
3420
|
-
start(agents) {
|
|
3421
|
-
for (const agent of agents) {
|
|
3422
|
-
let config;
|
|
3423
|
-
try {
|
|
3424
|
-
config = JSON.parse(agent.heartbeat_config);
|
|
3425
|
-
} catch {
|
|
3426
|
-
continue;
|
|
3427
|
-
}
|
|
3428
|
-
if (!config.enabled || !config.intervalSec) continue;
|
|
3429
|
-
const timer = setInterval(() => {
|
|
3430
|
-
void this.wakeupQueue.enqueue(agent.id, "heartbeat");
|
|
3431
|
-
}, config.intervalSec * 1e3);
|
|
3432
|
-
this.timers.set(agent.id, timer);
|
|
3433
|
-
}
|
|
3434
|
-
}
|
|
3435
|
-
stop() {
|
|
3436
|
-
for (const timer of this.timers.values()) {
|
|
3437
|
-
clearInterval(timer);
|
|
3438
|
-
}
|
|
3439
|
-
this.timers.clear();
|
|
3440
|
-
}
|
|
3441
|
-
};
|
|
3442
|
-
|
|
3443
3409
|
// src/core/orchestrator/scheduler.ts
|
|
3444
3410
|
import cronParser from "cron-parser";
|
|
3445
3411
|
import { v4 as uuid } from "uuid";
|
|
@@ -4194,7 +4160,6 @@ export {
|
|
|
4194
4160
|
DataStore,
|
|
4195
4161
|
DataStoreError,
|
|
4196
4162
|
EVENTS,
|
|
4197
|
-
HeartbeatScheduler,
|
|
4198
4163
|
HookBus,
|
|
4199
4164
|
MAX_CHAIN_DEPTH,
|
|
4200
4165
|
MessagePipeline,
|