@ebowwa/stack 0.3.0 → 0.3.2

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 (3) hide show
  1. package/dist/index.js +3278 -63297
  2. package/package.json +2 -2
  3. package/src/index.ts +28 -27
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ebowwa/stack",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Cross-channel AI stack with node-agent integration (SSH + Telegram + Ralph/Git)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "dev": "bun --hot run src/index.ts",
18
18
  "start": "bun run src/index.ts",
19
- "build": "bun build src/index.ts --target bun --outdir ./dist"
19
+ "build": "bun build src/index.ts --target bun --outdir ./dist --external @ebowwa/node-agent"
20
20
  },
21
21
  "keywords": [
22
22
  "stack",
package/src/index.ts CHANGED
@@ -38,14 +38,10 @@ import type { ChannelConnector, ChannelMessage, ChannelResponse, ChannelId } fro
38
38
  import { GLMClient } from "@ebowwa/ai";
39
39
  import { ToolExecutor, BUILTIN_TOOLS } from "@ebowwa/ai/tools";
40
40
 
41
- // Node Agent imports (services available but disabled)
42
- import {
43
- RalphService,
44
- GitService,
45
- ConsoleLoggerService,
46
- initializeStateService,
47
- getState,
48
- } from "@ebowwa/node-agent/lib";
41
+ // Node Agent types (lazy import to avoid bundling issues)
42
+ type RalphServiceType = InstanceType<typeof import("@ebowwa/node-agent/lib").RalphService>;
43
+ type GitServiceType = InstanceType<typeof import("@ebowwa/node-agent/lib").GitService>;
44
+ type ConsoleLoggerServiceType = InstanceType<typeof import("@ebowwa/node-agent/lib").ConsoleLoggerService>;
49
45
 
50
46
  // ============================================================
51
47
  // Types
@@ -111,10 +107,10 @@ export class Stack {
111
107
  private channels: Map<string, ChannelConnector> = new Map();
112
108
  private abortController: AbortController | null = null;
113
109
 
114
- // Node Agent services (initialized but may not be used)
115
- private ralphService: RalphService | null = null;
116
- private gitService: GitService | null = null;
117
- private consoleLogger: ConsoleLoggerService | null = null;
110
+ // Node Agent services (lazy loaded to avoid bundling issues)
111
+ private ralphService: RalphServiceType | null = null;
112
+ private gitService: GitServiceType | null = null;
113
+ private consoleLogger: ConsoleLoggerServiceType | null = null;
118
114
 
119
115
  constructor(config: StackConfig) {
120
116
  this.config = {
@@ -166,10 +162,7 @@ export class Stack {
166
162
  this.client = new GLMClient();
167
163
  this.executor = new ToolExecutor(this.client, [...BUILTIN_TOOLS]);
168
164
 
169
- // Initialize Node Agent services (but don't enable features yet)
170
- this.ralphService = new RalphService();
171
- this.gitService = new GitService();
172
- this.consoleLogger = new ConsoleLoggerService();
165
+ // Node Agent services initialized lazily in initializeNodeAgent()
173
166
  }
174
167
 
175
168
  // ============================================================
@@ -216,21 +209,29 @@ export class Stack {
216
209
  private async initializeNodeAgent(): Promise<void> {
217
210
  console.log("[Stack] Initializing Node Agent services...");
218
211
 
219
- // Initialize state service
212
+ // Lazy import to avoid bundling issues with node-agent
220
213
  try {
221
- await initializeStateService();
214
+ const nodeAgent = await import("@ebowwa/node-agent/lib");
215
+
216
+ // Initialize services (features disabled for now)
217
+ this.ralphService = new nodeAgent.RalphService();
218
+ this.gitService = new nodeAgent.GitService();
219
+ this.consoleLogger = new nodeAgent.ConsoleLoggerService();
220
+
221
+ // Initialize state service
222
+ await nodeAgent.initializeStateService();
222
223
  console.log("[Stack] State service initialized");
223
- } catch (error) {
224
- console.warn("[Stack] State service initialization failed (non-critical):", error);
225
- }
226
224
 
227
- // Ralph and Git services are instantiated but features are DISABLED
228
- // TODO: Enable when ready
229
- // this.ralphService?.startMonitoring();
230
- // this.gitService?.initialize();
225
+ // TODO: Enable Ralph/Git when ready
226
+ // this.ralphService?.startMonitoring();
227
+ // this.gitService?.initialize();
231
228
 
232
- this.state.nodeAgent.enabled = true;
233
- console.log("[Stack] Node Agent services ready (Ralph/Git DISABLED)");
229
+ this.state.nodeAgent.enabled = true;
230
+ console.log("[Stack] Node Agent services ready (Ralph/Git DISABLED)");
231
+ } catch (error) {
232
+ console.warn("[Stack] Node Agent initialization failed (non-critical):", error);
233
+ console.warn("[Stack] Continuing without Node Agent services");
234
+ }
234
235
  }
235
236
 
236
237
  // ============================================================