@aion0/forge 0.4.15 → 0.5.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.
Files changed (100) hide show
  1. package/CLAUDE.md +1 -1
  2. package/README.md +2 -2
  3. package/RELEASE_NOTES.md +170 -13
  4. package/app/api/agents/route.ts +17 -0
  5. package/app/api/delivery/[id]/route.ts +62 -0
  6. package/app/api/delivery/route.ts +40 -0
  7. package/app/api/mobile-chat/route.ts +13 -7
  8. package/app/api/monitor/route.ts +10 -6
  9. package/app/api/pipelines/[id]/route.ts +16 -3
  10. package/app/api/tasks/route.ts +2 -1
  11. package/app/api/workspace/[id]/agents/route.ts +35 -0
  12. package/app/api/workspace/[id]/memory/route.ts +23 -0
  13. package/app/api/workspace/[id]/smith/route.ts +22 -0
  14. package/app/api/workspace/[id]/stream/route.ts +28 -0
  15. package/app/api/workspace/route.ts +100 -0
  16. package/app/global-error.tsx +10 -4
  17. package/app/icon.ico +0 -0
  18. package/app/layout.tsx +2 -2
  19. package/app/login/LoginForm.tsx +96 -0
  20. package/app/login/page.tsx +7 -98
  21. package/app/page.tsx +2 -2
  22. package/bin/forge-server.mjs +23 -4
  23. package/check-forge-status.sh +9 -0
  24. package/cli/mw.ts +2 -2
  25. package/components/ConversationEditor.tsx +411 -0
  26. package/components/ConversationGraphView.tsx +347 -0
  27. package/components/ConversationTerminalView.tsx +303 -0
  28. package/components/Dashboard.tsx +36 -39
  29. package/components/DashboardWrapper.tsx +9 -0
  30. package/components/DeliveryFlowEditor.tsx +491 -0
  31. package/components/DeliveryList.tsx +230 -0
  32. package/components/DeliveryWorkspace.tsx +589 -0
  33. package/components/DocTerminal.tsx +12 -4
  34. package/components/DocsViewer.tsx +10 -2
  35. package/components/HelpTerminal.tsx +13 -8
  36. package/components/InlinePipelineView.tsx +111 -0
  37. package/components/MobileView.tsx +20 -0
  38. package/components/MonitorPanel.tsx +9 -4
  39. package/components/NewTaskModal.tsx +32 -0
  40. package/components/PipelineEditor.tsx +49 -6
  41. package/components/PipelineView.tsx +482 -64
  42. package/components/ProjectDetail.tsx +314 -56
  43. package/components/ProjectManager.tsx +49 -4
  44. package/components/SessionView.tsx +27 -13
  45. package/components/SettingsModal.tsx +790 -124
  46. package/components/SkillsPanel.tsx +34 -8
  47. package/components/TaskBoard.tsx +3 -0
  48. package/components/WebTerminal.tsx +259 -45
  49. package/components/WorkspaceTree.tsx +221 -0
  50. package/components/WorkspaceView.tsx +2224 -0
  51. package/docs/LOCAL-DEPLOY.md +15 -15
  52. package/install.sh +2 -2
  53. package/lib/agents/claude-adapter.ts +104 -0
  54. package/lib/agents/generic-adapter.ts +64 -0
  55. package/lib/agents/index.ts +242 -0
  56. package/lib/agents/types.ts +70 -0
  57. package/lib/artifacts.ts +106 -0
  58. package/lib/cloudflared.ts +1 -1
  59. package/lib/delivery.ts +787 -0
  60. package/lib/forge-skills/forge-inbox.md +37 -0
  61. package/lib/forge-skills/forge-send.md +40 -0
  62. package/lib/forge-skills/forge-status.md +32 -0
  63. package/lib/forge-skills/forge-workspace-sync.md +37 -0
  64. package/lib/help-docs/00-overview.md +8 -2
  65. package/lib/help-docs/01-settings.md +159 -2
  66. package/lib/help-docs/05-pipelines.md +95 -6
  67. package/lib/help-docs/07-projects.md +35 -1
  68. package/lib/help-docs/11-workspace.md +204 -0
  69. package/lib/help-docs/CLAUDE.md +5 -2
  70. package/lib/init.ts +62 -12
  71. package/lib/pipeline.ts +537 -1
  72. package/lib/settings.ts +115 -22
  73. package/lib/skills.ts +249 -372
  74. package/lib/task-manager.ts +113 -33
  75. package/lib/telegram-bot.ts +33 -1
  76. package/lib/telegram-standalone.ts +1 -1
  77. package/lib/terminal-server.ts +2 -2
  78. package/lib/terminal-standalone.ts +1 -1
  79. package/lib/workspace/__tests__/state-machine.test.ts +388 -0
  80. package/lib/workspace/__tests__/workspace.test.ts +311 -0
  81. package/lib/workspace/agent-bus.ts +416 -0
  82. package/lib/workspace/agent-worker.ts +667 -0
  83. package/lib/workspace/backends/api-backend.ts +262 -0
  84. package/lib/workspace/backends/cli-backend.ts +479 -0
  85. package/lib/workspace/index.ts +82 -0
  86. package/lib/workspace/manager.ts +136 -0
  87. package/lib/workspace/orchestrator.ts +1804 -0
  88. package/lib/workspace/persistence.ts +310 -0
  89. package/lib/workspace/presets.ts +170 -0
  90. package/lib/workspace/skill-installer.ts +188 -0
  91. package/lib/workspace/smith-memory.ts +498 -0
  92. package/lib/workspace/types.ts +231 -0
  93. package/lib/workspace/watch-manager.ts +288 -0
  94. package/lib/workspace-standalone.ts +790 -0
  95. package/middleware.ts +1 -0
  96. package/next-env.d.ts +1 -1
  97. package/package.json +5 -2
  98. package/src/config/index.ts +13 -2
  99. package/src/core/db/database.ts +1 -0
  100. package/start.sh +10 -0
package/middleware.ts CHANGED
@@ -8,6 +8,7 @@ export function middleware(req: NextRequest) {
8
8
  pathname.startsWith('/login') ||
9
9
  pathname.startsWith('/api/auth') ||
10
10
  pathname.startsWith('/api/telegram') ||
11
+ (pathname.startsWith('/api/workspace') && (pathname.includes('/smith') || pathname === '/api/workspace')) ||
11
12
  pathname.startsWith('/_next') ||
12
13
  pathname === '/favicon.ico' ||
13
14
  pathname === '/icon.png'
package/next-env.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="next" />
2
2
  /// <reference types="next/image-types/global" />
3
- import "./.next/dev/types/routes.d.ts";
3
+ import "./.next/types/routes.d.ts";
4
4
 
5
5
  // NOTE: This file should not be edited
6
6
  // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aion0/forge",
3
- "version": "0.4.15",
3
+ "version": "0.5.0",
4
4
  "description": "Unified AI workflow platform — multi-model task orchestration, persistent sessions, web terminal, remote access",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -33,11 +33,14 @@
33
33
  "@ai-sdk/openai": "^3.0.41",
34
34
  "@auth/core": "^0.34.3",
35
35
  "@xterm/addon-fit": "^0.11.0",
36
+ "@xterm/addon-search": "^0.16.0",
37
+ "@xterm/addon-unicode11": "^0.9.0",
38
+ "@xterm/addon-webgl": "^0.19.0",
36
39
  "@xterm/xterm": "^6.0.0",
37
40
  "@xyflow/react": "^12.10.1",
38
41
  "ai": "^6.0.116",
39
42
  "better-sqlite3": "^12.6.2",
40
- "next": "^16.1.6",
43
+ "next": "^16.2.1",
41
44
  "next-auth": "5.0.0-beta.30",
42
45
  "node-pty": "1.0.0",
43
46
  "react": "^19.2.4",
@@ -102,12 +102,23 @@ function getDefaultConfig(): AppConfig {
102
102
  },
103
103
  server: {
104
104
  host: '0.0.0.0',
105
- port: 3000,
105
+ port: 8403,
106
106
  },
107
107
  };
108
108
  }
109
109
 
110
- export function getProviderApiKey(provider: ProviderName): string | undefined {
110
+ export function getProviderApiKey(provider: ProviderName, profileApiKey?: string): string | undefined {
111
+ // Priority: profile-level key > settings provider key > env var
112
+ if (profileApiKey) return profileApiKey;
113
+
114
+ try {
115
+ const { loadSettings } = require('@/lib/settings');
116
+ const settings = loadSettings();
117
+ if (settings.providers?.[provider]?.apiKey) {
118
+ return settings.providers[provider].apiKey;
119
+ }
120
+ } catch {}
121
+
111
122
  const envMap: Record<ProviderName, string> = {
112
123
  anthropic: 'ANTHROPIC_API_KEY',
113
124
  google: 'GOOGLE_GENERATIVE_AI_API_KEY',
@@ -36,6 +36,7 @@ function initSchema(db: Database.Database) {
36
36
  migrate('ALTER TABLE skills ADD COLUMN deleted_remotely INTEGER NOT NULL DEFAULT 0');
37
37
  migrate('ALTER TABLE project_pipelines ADD COLUMN last_run_at TEXT');
38
38
  migrate('ALTER TABLE pipeline_runs ADD COLUMN dedup_key TEXT');
39
+ migrate("ALTER TABLE tasks ADD COLUMN agent TEXT DEFAULT 'claude'");
39
40
  // Recreate token_usage with day column (drop old version if schema changed)
40
41
  try { db.exec("SELECT day FROM token_usage LIMIT 1"); } catch { try { db.exec("DROP TABLE IF EXISTS token_usage"); db.exec("DROP TABLE IF EXISTS usage_scan_state"); } catch {} }
41
42
  // Unique index for dedup (only applies when dedup_key is NOT NULL)
package/start.sh CHANGED
@@ -8,12 +8,22 @@
8
8
  # Kill all old forge processes
9
9
  pkill -f 'telegram-standalone' 2>/dev/null
10
10
  pkill -f 'terminal-standalone' 2>/dev/null
11
+ pkill -f 'workspace-standalone' 2>/dev/null
11
12
  pkill -f 'cloudflared tunnel' 2>/dev/null
13
+ # Wait for workspace daemon port to be released
14
+ for i in 1 2 3; do
15
+ lsof -ti:${WORKSPACE_PORT:-8405} >/dev/null 2>&1 || break
16
+ sleep 1
17
+ done
12
18
  pkill -f 'next-server' 2>/dev/null
13
19
  pkill -f 'next start' 2>/dev/null
14
20
  pkill -f 'next dev' 2>/dev/null
15
21
  sleep 1
16
22
 
23
+ export PORT=${PORT:-8403}
24
+ export TERMINAL_PORT=${TERMINAL_PORT:-8404}
25
+ export WORKSPACE_PORT=${WORKSPACE_PORT:-8405}
26
+
17
27
  if [ "$1" = "dev" ]; then
18
28
  pnpm dev
19
29
  else