@aion0/forge 0.10.83 → 0.10.85

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.
@@ -360,12 +360,12 @@ function buildConnectorCatalog(openSet: Set<string>): string[] {
360
360
  return lines;
361
361
  }
362
362
 
363
- function buildSystemPrompt(
363
+ async function buildSystemPrompt(
364
364
  openConnectorTools: LlmTool[],
365
365
  openSet: Set<string>,
366
366
  builtinDefs: typeof BUILTIN_TOOL_DEFS,
367
367
  sessionSystemPrompt: string | null,
368
- ): string {
368
+ ): Promise<string> {
369
369
  const now = new Date().toISOString();
370
370
 
371
371
  // Inject a brief Forge context block (project names only) so the LLM can
@@ -375,7 +375,7 @@ function buildSystemPrompt(
375
375
  // names are cheap enough to ship every turn.
376
376
  let projectNames: string[] = [];
377
377
  try {
378
- const { scanProjects } = require('../projects') as typeof import('../projects');
378
+ const { scanProjects } = await import('../projects');
379
379
  projectNames = scanProjects().map((p) => p.name);
380
380
  } catch { /* projects roots not configured / read failed — omit */ }
381
381
 
@@ -751,8 +751,8 @@ export async function runTurn(args: RunTurnArgs): Promise<{ ok: boolean; error?:
751
751
  }
752
752
 
753
753
  const sessionSystemPrompt = session.system_prompt;
754
- function buildSystem(openTools: LlmTool[], openSet: Set<string>): string {
755
- let s = buildSystemPrompt(openTools, openSet, builtinDefsAll, sessionSystemPrompt);
754
+ async function buildSystem(openTools: LlmTool[], openSet: Set<string>): Promise<string> {
755
+ let s = await buildSystemPrompt(openTools, openSet, builtinDefsAll, sessionSystemPrompt);
756
756
  if (narrowDirective) s += narrowDirective;
757
757
  return s;
758
758
  }
@@ -766,7 +766,7 @@ export async function runTurn(args: RunTurnArgs): Promise<{ ok: boolean; error?:
766
766
  // per-iteration when the profile's maxInputTokens is tight. The
767
767
  // assembled string is recomputed each iter (after open-set + memory
768
768
  // trim). `system` here holds the base (no memory section).
769
- let system = buildSystem(openConnectorTools, openSet);
769
+ let system = await buildSystem(openConnectorTools, openSet);
770
770
  if (memStore.enabled) {
771
771
  const searchHint = memStore.kind === 'local'
772
772
  ? '• memory_search is keyword LIKE over local blocks + episodes — useful for finding past notes; prefer memory_get_block / memory_list_blocks for first-person facts.'
@@ -848,7 +848,7 @@ export async function runTurn(args: RunTurnArgs): Promise<{ ok: boolean; error?:
848
848
  openSet = newOpenSet;
849
849
  openConnectorTools = allConnectorTools.filter((t) => openSet.has(t.name.split('.')[0]!));
850
850
  allTools = [...builtinToolDefs, ...openConnectorTools];
851
- system = buildSystem(openConnectorTools, openSet);
851
+ system = await buildSystem(openConnectorTools, openSet);
852
852
  console.log(`[chat] open set → {${[...openSet].join(',')}} (${openConnectorTools.length} connector tools active)`);
853
853
  }
854
854
 
@@ -1071,10 +1071,9 @@ export async function runTurn(args: RunTurnArgs): Promise<{ ok: boolean; error?:
1071
1071
  const leftovers = consumeNotes(args.sessionId);
1072
1072
  endTurn(args.sessionId);
1073
1073
  if (leftovers.length > 0) {
1074
- // Lazy require: input-queue imports runTurn from this module —
1075
- // a static import here would be circular.
1076
- // eslint-disable-next-line @typescript-eslint/no-require-imports
1077
- const { enqueueChatInput } = require('./input-queue') as typeof import('./input-queue');
1074
+ // Lazy dynamic import: input-queue imports runTurn from this module —
1075
+ // a static import here would be circular. ESM requires await import (no require).
1076
+ const { enqueueChatInput } = await import('./input-queue');
1078
1077
  for (const text of leftovers) {
1079
1078
  enqueueChatInput({
1080
1079
  sessionId: args.sessionId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aion0/forge",
3
- "version": "0.10.83",
3
+ "version": "0.10.85",
4
4
  "description": "Unified AI workflow platform — multi-model task orchestration, persistent sessions, web terminal, remote access",
5
5
  "type": "module",
6
6
  "scripts": {