@supaku/agentfactory-server 0.4.5 → 0.4.7
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/src/agent-tracking.js +1 -1
- package/dist/src/env-validation.js +1 -1
- package/dist/src/index.d.ts +16 -16
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +16 -16
- package/dist/src/issue-lock.d.ts +2 -2
- package/dist/src/issue-lock.d.ts.map +1 -1
- package/dist/src/issue-lock.js +3 -3
- package/dist/src/orphan-cleanup.d.ts +1 -1
- package/dist/src/orphan-cleanup.d.ts.map +1 -1
- package/dist/src/orphan-cleanup.js +5 -5
- package/dist/src/pending-prompts.js +2 -2
- package/dist/src/rate-limit.js +1 -1
- package/dist/src/session-hash.js +1 -1
- package/dist/src/session-storage.d.ts +1 -1
- package/dist/src/session-storage.d.ts.map +1 -1
- package/dist/src/session-storage.js +1 -1
- package/dist/src/token-storage.js +2 -2
- package/dist/src/webhook-idempotency.js +1 -1
- package/dist/src/work-queue.d.ts +2 -2
- package/dist/src/work-queue.d.ts.map +1 -1
- package/dist/src/work-queue.js +1 -1
- package/dist/src/worker-storage.js +1 -1
- package/package.json +3 -3
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Tracks which issues the agent has worked on to enable automated QA pickup.
|
|
5
5
|
* Also tracks QA attempts to prevent infinite loops.
|
|
6
6
|
*/
|
|
7
|
-
import { redisSet, redisGet, redisExists, redisDel } from './redis';
|
|
7
|
+
import { redisSet, redisGet, redisExists, redisDel } from './redis.js';
|
|
8
8
|
const log = {
|
|
9
9
|
info: (msg, data) => console.log(`[tracking] ${msg}`, data ? JSON.stringify(data) : ''),
|
|
10
10
|
warn: (msg, data) => console.warn(`[tracking] ${msg}`, data ? JSON.stringify(data) : ''),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Validates required environment variables on startup.
|
|
5
5
|
* Fails fast if critical security variables are missing in production.
|
|
6
6
|
*/
|
|
7
|
-
import { createLogger } from './logger';
|
|
7
|
+
import { createLogger } from './logger.js';
|
|
8
8
|
const log = createLogger('env-validation');
|
|
9
9
|
/**
|
|
10
10
|
* Default required environment variables for production
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export * from './logger';
|
|
2
|
-
export * from './types';
|
|
3
|
-
export * from './redis';
|
|
4
|
-
export * from './session-storage';
|
|
5
|
-
export * from './work-queue';
|
|
6
|
-
export * from './worker-storage';
|
|
7
|
-
export * from './issue-lock';
|
|
8
|
-
export * from './agent-tracking';
|
|
9
|
-
export * from './webhook-idempotency';
|
|
10
|
-
export * from './pending-prompts';
|
|
11
|
-
export * from './orphan-cleanup';
|
|
12
|
-
export * from './worker-auth';
|
|
13
|
-
export * from './session-hash';
|
|
14
|
-
export * from './rate-limit';
|
|
15
|
-
export * from './token-storage';
|
|
16
|
-
export * from './env-validation';
|
|
1
|
+
export * from './logger.js';
|
|
2
|
+
export * from './types.js';
|
|
3
|
+
export * from './redis.js';
|
|
4
|
+
export * from './session-storage.js';
|
|
5
|
+
export * from './work-queue.js';
|
|
6
|
+
export * from './worker-storage.js';
|
|
7
|
+
export * from './issue-lock.js';
|
|
8
|
+
export * from './agent-tracking.js';
|
|
9
|
+
export * from './webhook-idempotency.js';
|
|
10
|
+
export * from './pending-prompts.js';
|
|
11
|
+
export * from './orphan-cleanup.js';
|
|
12
|
+
export * from './worker-auth.js';
|
|
13
|
+
export * from './session-hash.js';
|
|
14
|
+
export * from './rate-limit.js';
|
|
15
|
+
export * from './token-storage.js';
|
|
16
|
+
export * from './env-validation.js';
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAG3B,cAAc,YAAY,CAAA;AAG1B,cAAc,YAAY,CAAA;AAG1B,cAAc,sBAAsB,CAAA;AAGpC,cAAc,iBAAiB,CAAA;AAG/B,cAAc,qBAAqB,CAAA;AAGnC,cAAc,iBAAiB,CAAA;AAG/B,cAAc,qBAAqB,CAAA;AAGnC,cAAc,0BAA0B,CAAA;AAGxC,cAAc,sBAAsB,CAAA;AAGpC,cAAc,qBAAqB,CAAA;AAGnC,cAAc,kBAAkB,CAAA;AAGhC,cAAc,mBAAmB,CAAA;AAGjC,cAAc,iBAAiB,CAAA;AAG/B,cAAc,oBAAoB,CAAA;AAGlC,cAAc,qBAAqB,CAAA"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
// Logger
|
|
2
|
-
export * from './logger';
|
|
2
|
+
export * from './logger.js';
|
|
3
3
|
// Types
|
|
4
|
-
export * from './types';
|
|
4
|
+
export * from './types.js';
|
|
5
5
|
// Redis client
|
|
6
|
-
export * from './redis';
|
|
6
|
+
export * from './redis.js';
|
|
7
7
|
// Session management
|
|
8
|
-
export * from './session-storage';
|
|
8
|
+
export * from './session-storage.js';
|
|
9
9
|
// Work queue
|
|
10
|
-
export * from './work-queue';
|
|
10
|
+
export * from './work-queue.js';
|
|
11
11
|
// Worker pool
|
|
12
|
-
export * from './worker-storage';
|
|
12
|
+
export * from './worker-storage.js';
|
|
13
13
|
// Issue locking
|
|
14
|
-
export * from './issue-lock';
|
|
14
|
+
export * from './issue-lock.js';
|
|
15
15
|
// Agent tracking
|
|
16
|
-
export * from './agent-tracking';
|
|
16
|
+
export * from './agent-tracking.js';
|
|
17
17
|
// Webhook idempotency
|
|
18
|
-
export * from './webhook-idempotency';
|
|
18
|
+
export * from './webhook-idempotency.js';
|
|
19
19
|
// Pending prompts
|
|
20
|
-
export * from './pending-prompts';
|
|
20
|
+
export * from './pending-prompts.js';
|
|
21
21
|
// Orphan cleanup
|
|
22
|
-
export * from './orphan-cleanup';
|
|
22
|
+
export * from './orphan-cleanup.js';
|
|
23
23
|
// Worker authentication
|
|
24
|
-
export * from './worker-auth';
|
|
24
|
+
export * from './worker-auth.js';
|
|
25
25
|
// Session hashing
|
|
26
|
-
export * from './session-hash';
|
|
26
|
+
export * from './session-hash.js';
|
|
27
27
|
// Rate limiting
|
|
28
|
-
export * from './rate-limit';
|
|
28
|
+
export * from './rate-limit.js';
|
|
29
29
|
// Token storage
|
|
30
|
-
export * from './token-storage';
|
|
30
|
+
export * from './token-storage.js';
|
|
31
31
|
// Environment validation
|
|
32
|
-
export * from './env-validation';
|
|
32
|
+
export * from './env-validation.js';
|
package/dist/src/issue-lock.d.ts
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* - issue:pending:{issueId} -- Sorted Set (priority-ordered session IDs)
|
|
12
12
|
* - issue:pending:items:{issueId} -- Hash (sessionId -> JSON QueuedWork)
|
|
13
13
|
*/
|
|
14
|
-
import { type QueuedWork } from './work-queue';
|
|
15
|
-
import type { AgentWorkType } from './types';
|
|
14
|
+
import { type QueuedWork } from './work-queue.js';
|
|
15
|
+
import type { AgentWorkType } from './types.js';
|
|
16
16
|
/**
|
|
17
17
|
* Lock payload stored in Redis
|
|
18
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-lock.d.ts","sourceRoot":"","sources":["../../src/issue-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAmBH,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"issue-lock.d.ts","sourceRoot":"","sources":["../../src/issue-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAmBH,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAoB/C;;GAEG;AACH,MAAM,WAAW,SAAS;IACx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E;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAsClB;AAED;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAwBlB;AAED;;;;;GAKG;AACH,wBAAsB,kCAAkC,IAAI,OAAO,CAAC,MAAM,CAAC,CA0C1E;AAID;;;;;;;;;;;;GAYG;AACH,wBAAsB,gCAAgC,CACpD,cAAc,EAAE,OAAO,GACtB,OAAO,CAAC,MAAM,CAAC,CAgEjB"}
|
package/dist/src/issue-lock.js
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
* - issue:pending:{issueId} -- Sorted Set (priority-ordered session IDs)
|
|
12
12
|
* - issue:pending:items:{issueId} -- Hash (sessionId -> JSON QueuedWork)
|
|
13
13
|
*/
|
|
14
|
-
import { redisSetNX, redisGet, redisDel, redisExpire, redisZAdd, redisZRem, redisZPopMin, redisZCard, redisHSet, redisHGet, redisHDel, redisHGetAll, isRedisConfigured, redisKeys, } from './redis';
|
|
15
|
-
import { queueWork } from './work-queue';
|
|
16
|
-
import { getSessionState } from './session-storage';
|
|
14
|
+
import { redisSetNX, redisGet, redisDel, redisExpire, redisZAdd, redisZRem, redisZPopMin, redisZCard, redisHSet, redisHGet, redisHDel, redisHGetAll, isRedisConfigured, redisKeys, } from './redis.js';
|
|
15
|
+
import { queueWork } from './work-queue.js';
|
|
16
|
+
import { getSessionState } from './session-storage.js';
|
|
17
17
|
const log = {
|
|
18
18
|
info: (msg, data) => console.log(`[issue-lock] ${msg}`, data ? JSON.stringify(data) : ''),
|
|
19
19
|
warn: (msg, data) => console.warn(`[issue-lock] ${msg}`, data ? JSON.stringify(data) : ''),
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* The Linear issue status is NOT rolled back - the issue remains in its current
|
|
9
9
|
* workflow state and the next worker will resume from where the previous one left off.
|
|
10
10
|
*/
|
|
11
|
-
import { type AgentSessionState } from './session-storage';
|
|
11
|
+
import { type AgentSessionState } from './session-storage.js';
|
|
12
12
|
/**
|
|
13
13
|
* Callback for when an orphaned session is re-queued
|
|
14
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orphan-cleanup.d.ts","sourceRoot":"","sources":["../../src/orphan-cleanup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"orphan-cleanup.d.ts","sourceRoot":"","sources":["../../src/orphan-cleanup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAA;AAmB7B;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAChE,2FAA2F;IAC3F,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAClE;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,KAAK,CAAC;QACb,SAAS,EAAE,MAAM,CAAA;QACjB,eAAe,EAAE,MAAM,CAAA;QACvB,MAAM,EAAE,UAAU,GAAG,QAAQ,CAAA;QAC7B,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,oEAAoE;QACpE,YAAY,CAAC,EAAE,MAAM,CAAA;KACtB,CAAC,CAAA;IACF,0DAA0D;IAC1D,sBAAsB,EAAE,MAAM,EAAE,CAAA;CACjC;AAED;;GAEG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA4CzE;AAKD;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAiC9E;AAED;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,SAAS,CAAC,EAAE,sBAAsB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CA+N9B;AASD,wBAAgB,gBAAgB,IAAI,OAAO,CAO1C;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,CAAC,EAAE,sBAAsB,GACjC,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAKrC"}
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
* The Linear issue status is NOT rolled back - the issue remains in its current
|
|
9
9
|
* workflow state and the next worker will resume from where the previous one left off.
|
|
10
10
|
*/
|
|
11
|
-
import { createLogger } from './logger';
|
|
12
|
-
import { getAllSessions, resetSessionForRequeue, } from './session-storage';
|
|
13
|
-
import { listWorkers } from './worker-storage';
|
|
14
|
-
import { releaseClaim, isSessionInQueue, } from './work-queue';
|
|
15
|
-
import { dispatchWork, cleanupExpiredLocksWithPendingWork, cleanupStaleLocksWithIdleWorkers, isSessionParkedForIssue, } from './issue-lock';
|
|
11
|
+
import { createLogger } from './logger.js';
|
|
12
|
+
import { getAllSessions, resetSessionForRequeue, } from './session-storage.js';
|
|
13
|
+
import { listWorkers } from './worker-storage.js';
|
|
14
|
+
import { releaseClaim, isSessionInQueue, } from './work-queue.js';
|
|
15
|
+
import { dispatchWork, cleanupExpiredLocksWithPendingWork, cleanupStaleLocksWithIdleWorkers, isSessionParkedForIssue, } from './issue-lock.js';
|
|
16
16
|
const log = createLogger('orphan-cleanup');
|
|
17
17
|
// How long a session can be running without a valid worker before being considered orphaned
|
|
18
18
|
const ORPHAN_THRESHOLD_MS = 120_000; // 2 minutes (worker TTL + buffer)
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* Stores follow-up prompts for running agent sessions.
|
|
5
5
|
* Workers poll for pending prompts and forward them to their running Claude processes.
|
|
6
6
|
*/
|
|
7
|
-
import { redisRPush, redisLRange, redisLRem, redisLLen, redisDel, isRedisConfigured, } from './redis';
|
|
8
|
-
import { createLogger } from './logger';
|
|
7
|
+
import { redisRPush, redisLRange, redisLRem, redisLLen, redisDel, isRedisConfigured, } from './redis.js';
|
|
8
|
+
import { createLogger } from './logger.js';
|
|
9
9
|
const log = createLogger('pending-prompts');
|
|
10
10
|
// Redis key prefix for pending prompts per session
|
|
11
11
|
const PENDING_PROMPTS_PREFIX = 'session:prompts:';
|
package/dist/src/rate-limit.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* In-memory rate limiting using sliding window algorithm.
|
|
5
5
|
* Uses LRU cache to prevent memory bloat from tracking many IPs.
|
|
6
6
|
*/
|
|
7
|
-
import { createLogger } from './logger';
|
|
7
|
+
import { createLogger } from './logger.js';
|
|
8
8
|
const log = createLogger('rate-limit');
|
|
9
9
|
/**
|
|
10
10
|
* Default rate limit configurations by endpoint type
|
package/dist/src/session-hash.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* and hide internal structure from public viewers.
|
|
7
7
|
*/
|
|
8
8
|
import crypto from 'crypto';
|
|
9
|
-
import { getSessionHashSalt, isSessionHashConfigured } from './env-validation';
|
|
9
|
+
import { getSessionHashSalt, isSessionHashConfigured } from './env-validation.js';
|
|
10
10
|
/**
|
|
11
11
|
* Create a public hash from a session ID
|
|
12
12
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-storage.d.ts","sourceRoot":"","sources":["../../src/session-storage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"session-storage.d.ts","sourceRoot":"","sources":["../../src/session-storage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK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mBAAmB,CACvC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,GAChD,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAI9B;AAED;;;;;;;;GAQG;AACH,wBAAsB,wBAAwB,CAC5C,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC;IAAE,WAAW,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAyCpD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isRedisConfigured, redisSet, redisGet, redisDel, redisKeys } from './redis';
|
|
1
|
+
import { isRedisConfigured, redisSet, redisGet, redisDel, redisKeys } from './redis.js';
|
|
2
2
|
const log = {
|
|
3
3
|
info: (msg, data) => console.log(`[session] ${msg}`, data ? JSON.stringify(data) : ''),
|
|
4
4
|
warn: (msg, data) => console.warn(`[session] ${msg}`, data ? JSON.stringify(data) : ''),
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* - Automatic token refresh before expiration
|
|
7
7
|
* - Multi-workspace token support
|
|
8
8
|
*/
|
|
9
|
-
import { createLogger } from './logger';
|
|
10
|
-
import { isRedisConfigured, redisSet, redisGet, redisDel, redisKeys } from './redis';
|
|
9
|
+
import { createLogger } from './logger.js';
|
|
10
|
+
import { isRedisConfigured, redisSet, redisGet, redisDel, redisKeys } from './redis.js';
|
|
11
11
|
const log = createLogger('token-storage');
|
|
12
12
|
/**
|
|
13
13
|
* Key prefix for workspace tokens in KV
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Uses webhookId (unique per delivery) as the primary key, falling back
|
|
9
9
|
* to sessionId if webhookId is not available.
|
|
10
10
|
*/
|
|
11
|
-
import { isRedisConfigured, redisSet, redisExists, redisDel } from './redis';
|
|
11
|
+
import { isRedisConfigured, redisSet, redisExists, redisDel } from './redis.js';
|
|
12
12
|
const log = {
|
|
13
13
|
info: (msg, data) => console.log(`[idempotency] ${msg}`, data ? JSON.stringify(data) : ''),
|
|
14
14
|
warn: (msg, data) => console.warn(`[idempotency] ${msg}`, data ? JSON.stringify(data) : ''),
|
package/dist/src/work-queue.d.ts
CHANGED
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
* - peekWork: O(log n + k) - ZRANGEBYSCORE + HMGET where k = limit
|
|
16
16
|
* - getQueueLength: O(1) - ZCARD
|
|
17
17
|
*/
|
|
18
|
-
import type { AgentWorkType } from './types';
|
|
18
|
+
import type { AgentWorkType } from './types.js';
|
|
19
19
|
/**
|
|
20
20
|
* Type of work being performed
|
|
21
|
-
* @deprecated Use AgentWorkType from './types' instead
|
|
21
|
+
* @deprecated Use AgentWorkType from './types.js' instead
|
|
22
22
|
*/
|
|
23
23
|
export type WorkType = AgentWorkType;
|
|
24
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-queue.d.ts","sourceRoot":"","sources":["../../src/work-queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAqBH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"work-queue.d.ts","sourceRoot":"","sources":["../../src/work-queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAqBH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAoB/C;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,aAAa,CAAA;AAEpC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,eAAe,CAAC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17
|
*/
|
|
18
18
|
import { redisSetNX, redisDel, redisGet, redisZAdd, redisZRem, redisZRangeByScore, redisZCard, redisHSet, redisHGet, redisHDel, redisHMGet, isRedisConfigured,
|
|
19
19
|
// Legacy list operations for migration
|
|
20
|
-
redisLRange, redisLRem, } from './redis';
|
|
20
|
+
redisLRange, redisLRem, } from './redis.js';
|
|
21
21
|
const log = {
|
|
22
22
|
info: (msg, data) => console.log(`[work-queue] ${msg}`, data ? JSON.stringify(data) : ''),
|
|
23
23
|
warn: (msg, data) => console.warn(`[work-queue] ${msg}`, data ? JSON.stringify(data) : ''),
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* and deregister on shutdown.
|
|
7
7
|
*/
|
|
8
8
|
import crypto from 'crypto';
|
|
9
|
-
import { redisSet, redisGet, redisDel, redisKeys, redisSAdd, redisSRem, redisSMembers, isRedisConfigured, } from './redis';
|
|
9
|
+
import { redisSet, redisGet, redisDel, redisKeys, redisSAdd, redisSRem, redisSMembers, isRedisConfigured, } from './redis.js';
|
|
10
10
|
const log = {
|
|
11
11
|
info: (msg, data) => console.log(`[worker] ${msg}`, data ? JSON.stringify(data) : ''),
|
|
12
12
|
warn: (msg, data) => console.warn(`[worker] ${msg}`, data ? JSON.stringify(data) : ''),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supaku/agentfactory-server",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Webhook server and distributed worker pool for AgentFactory — Redis queues, issue locks, session management",
|
|
6
6
|
"author": "Supaku (https://supaku.com)",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"ioredis": "^5.4.2",
|
|
47
|
-
"@supaku/agentfactory
|
|
48
|
-
"@supaku/agentfactory": "0.4.
|
|
47
|
+
"@supaku/agentfactory": "0.4.7",
|
|
48
|
+
"@supaku/agentfactory-linear": "0.4.7"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "^22.5.4",
|