@aion0/forge 0.6.1 → 0.8.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/.forge/mcp.json +8 -0
- package/.forge/worktrees/pipeline-0a33c50d/lib/help-docs/01-settings.md +5 -5
- package/.forge/worktrees/pipeline-0a33c50d/lib/help-docs/07-projects.md +1 -1
- package/.forge/worktrees/pipeline-2ba01c10/lib/help-docs/01-settings.md +5 -5
- package/.forge/worktrees/pipeline-2ba01c10/lib/help-docs/07-projects.md +1 -1
- package/.forge/worktrees/pipeline-3156a8b3/lib/help-docs/01-settings.md +5 -5
- package/.forge/worktrees/pipeline-3156a8b3/lib/help-docs/07-projects.md +1 -1
- package/.forge/worktrees/pipeline-316c6574/lib/help-docs/01-settings.md +5 -5
- package/.forge/worktrees/pipeline-316c6574/lib/help-docs/07-projects.md +1 -1
- package/.forge/worktrees/pipeline-44a94121/lib/help-docs/01-settings.md +5 -5
- package/.forge/worktrees/pipeline-44a94121/lib/help-docs/07-projects.md +1 -1
- package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/01-settings.md +5 -5
- package/.forge/worktrees/pipeline-4dd8dc2d/lib/help-docs/07-projects.md +1 -1
- package/.forge/worktrees/pipeline-d1757a50/lib/help-docs/01-settings.md +5 -5
- package/.forge/worktrees/pipeline-d1757a50/lib/help-docs/07-projects.md +1 -1
- package/.forge/worktrees/pipeline-d59c2fe2/lib/help-docs/01-settings.md +5 -5
- package/.forge/worktrees/pipeline-d59c2fe2/lib/help-docs/07-projects.md +1 -1
- package/.forge/worktrees/pipeline-d6a6ef23/lib/help-docs/01-settings.md +5 -5
- package/.forge/worktrees/pipeline-d6a6ef23/lib/help-docs/07-projects.md +1 -1
- package/.forge/worktrees/pipeline-e7f78b7a/lib/help-docs/01-settings.md +5 -5
- package/.forge/worktrees/pipeline-e7f78b7a/lib/help-docs/07-projects.md +1 -1
- package/.forge/worktrees/pipeline-e97c13c7/lib/help-docs/01-settings.md +5 -5
- package/.forge/worktrees/pipeline-e97c13c7/lib/help-docs/07-projects.md +1 -1
- package/.forge/worktrees/pipeline-ecd7cb0f/lib/help-docs/01-settings.md +5 -5
- package/.forge/worktrees/pipeline-ecd7cb0f/lib/help-docs/07-projects.md +1 -1
- package/CLAUDE.md +2 -2
- package/RELEASE_NOTES.md +101 -5
- package/app/api/auth/check/route.ts +18 -0
- package/app/api/browser-bridge/route.ts +70 -0
- package/app/api/chat/sessions/[id]/events/route.ts +17 -0
- package/app/api/chat/sessions/[id]/fork/route.ts +15 -0
- package/app/api/chat/sessions/[id]/messages/route.ts +21 -0
- package/app/api/chat/sessions/[id]/route.ts +23 -0
- package/app/api/chat/sessions/route.ts +12 -0
- package/app/api/chat/temper-ping/route.ts +18 -0
- package/app/api/chat-proxy/[...path]/route.ts +83 -0
- package/app/api/connector-tool/route.ts +38 -0
- package/app/api/connectors/[id]/settings/route.ts +112 -0
- package/app/api/connectors/route.ts +108 -0
- package/app/api/health/tools/route.ts +14 -0
- package/app/api/issue-scanner-gitlab/route.ts +95 -0
- package/app/api/jobs/[id]/reset_dedup/route.ts +15 -0
- package/app/api/jobs/[id]/route.ts +31 -0
- package/app/api/jobs/[id]/run/route.ts +44 -0
- package/app/api/jobs/[id]/runs/[runId]/route.ts +15 -0
- package/app/api/jobs/[id]/runs/route.ts +15 -0
- package/app/api/jobs/preview/route.ts +193 -0
- package/app/api/jobs/route.ts +36 -0
- package/app/api/notify/test/route.ts +39 -7
- package/app/api/pipelines/[id]/route.ts +10 -1
- package/app/api/pipelines/route.ts +16 -2
- package/app/api/plugins/route.ts +40 -8
- package/app/api/project-sessions/route.ts +50 -10
- package/app/api/settings/route.ts +13 -0
- package/app/chat/page.tsx +531 -0
- package/bin/forge-server.mjs +3 -1
- package/cli/chat.ts +283 -0
- package/cli/jobs.ts +176 -0
- package/cli/mw.ts +28 -1
- package/cli/worktree.ts +245 -0
- package/components/ConnectorsPanel.tsx +275 -0
- package/components/Dashboard.tsx +90 -37
- package/components/JobsView.tsx +361 -0
- package/components/LogViewer.tsx +12 -2
- package/components/PipelineView.tsx +275 -56
- package/components/PluginsPanel.tsx +3 -1
- package/components/SettingsModal.tsx +229 -40
- package/components/SkillsPanel.tsx +12 -4
- package/components/TerminalLauncher.tsx +3 -1
- package/components/WebTerminal.tsx +32 -9
- package/components/WorkspaceView.tsx +18 -10
- package/docs/Connector-DeclarativeExtract-Handoff.md +471 -0
- package/docs/Connector-DeclarativeExtract-Spec.md +364 -0
- package/docs/Implementation-Plan-Browser-Agent.md +487 -0
- package/docs/Jobs-Design.md +240 -0
- package/docs/LOCAL-DEPLOY.md +3 -3
- package/docs/RFC-Browser-Connectors.md +509 -0
- package/lib/agents/index.ts +44 -6
- package/lib/agents/types.ts +1 -1
- package/lib/browser-bridge-standalone.ts +317 -0
- package/lib/builtin-plugins/github-api.yaml +93 -0
- package/lib/builtin-plugins/gitlab.yaml +860 -0
- package/lib/builtin-plugins/mantis.probe.js +176 -0
- package/lib/builtin-plugins/mantis.yaml +964 -0
- package/lib/builtin-plugins/pmdb.yaml +178 -0
- package/lib/builtin-plugins/teams.yaml +913 -0
- package/lib/chat/__test__/smoke.ts +30 -0
- package/lib/chat/agent-loop.ts +523 -0
- package/lib/chat/bridge-client.ts +59 -0
- package/lib/chat/llm/anthropic.ts +99 -0
- package/lib/chat/llm/index.ts +20 -0
- package/lib/chat/llm/openai.ts +215 -0
- package/lib/chat/llm/types.ts +42 -0
- package/lib/chat/local-memory.ts +300 -0
- package/lib/chat/memory-store.ts +87 -0
- package/lib/chat/memory-tools.ts +157 -0
- package/lib/chat/protocols/http.ts +118 -0
- package/lib/chat/protocols/shell.ts +101 -0
- package/lib/chat/proxy.ts +51 -0
- package/lib/chat/session-store.ts +272 -0
- package/lib/chat/telegram-bridge.ts +276 -0
- package/lib/chat/temper.ts +281 -0
- package/lib/chat/tool-dispatcher.ts +190 -0
- package/lib/chat/types.ts +50 -0
- package/lib/chat-standalone.ts +286 -0
- package/lib/crypto.ts +1 -1
- package/lib/health.ts +131 -0
- package/lib/help-docs/00-overview.md +2 -1
- package/lib/help-docs/01-settings.md +46 -25
- package/lib/help-docs/07-projects.md +1 -1
- package/lib/help-docs/10-troubleshooting.md +10 -2
- package/lib/help-docs/16-gitlab-autofix.md +114 -0
- package/lib/help-docs/17-connectors.md +322 -0
- package/lib/help-docs/18-chrome-mcp.md +134 -0
- package/lib/help-docs/19-jobs.md +140 -0
- package/lib/help-docs/20-mantis-bug-fix.md +115 -0
- package/lib/help-docs/CLAUDE.md +10 -0
- package/lib/init.ts +137 -50
- package/lib/iso-time.ts +30 -0
- package/lib/issue-scanner-gitlab.ts +281 -0
- package/lib/jobs/dispatcher.ts +217 -0
- package/lib/jobs/scheduler.ts +334 -0
- package/lib/jobs/store.ts +319 -0
- package/lib/jobs/types.ts +117 -0
- package/lib/pipeline-scheduler.ts +1 -6
- package/lib/pipeline.ts +790 -10
- package/lib/plugins/registry.ts +133 -8
- package/lib/plugins/templates.ts +83 -0
- package/lib/plugins/types.ts +140 -1
- package/lib/session-watcher.ts +36 -10
- package/lib/settings.ts +65 -33
- package/lib/skills.ts +3 -1
- package/lib/task-manager.ts +50 -22
- package/lib/telegram-bot.ts +71 -0
- package/lib/terminal-standalone.ts +58 -36
- package/lib/workspace/orchestrator.ts +1 -0
- package/middleware.ts +10 -0
- package/package.json +3 -2
- package/scripts/bench/README.md +1 -1
- package/scripts/bench/tasks/01-text-utils/validator.sh +1 -1
- package/scripts/bench/tasks/02-pagination/setup.sh +1 -1
- package/scripts/bench/tasks/02-pagination/validator.sh +1 -1
- package/scripts/bench/tasks/03-bug-fix/setup.sh +1 -1
- package/scripts/bench/tasks/03-bug-fix/validator.sh +1 -1
- package/src/core/db/database.ts +21 -12
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Job types — see docs/Jobs-Design.md.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type DispatchType = 'pipeline' | 'chat';
|
|
6
|
+
export type JobRunStatus = 'running' | 'ok' | 'error';
|
|
7
|
+
export type JobRunTrigger = 'schedule' | 'manual';
|
|
8
|
+
export type JobDispatchStatus = 'dispatched' | 'error';
|
|
9
|
+
|
|
10
|
+
export interface PipelineDispatchParams {
|
|
11
|
+
workflow_name: string;
|
|
12
|
+
project_path: string;
|
|
13
|
+
project_name: string;
|
|
14
|
+
/** Per-item template; string values render `{{item.<path>}}` substitutions. */
|
|
15
|
+
input_template: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ChatDispatchParams {
|
|
19
|
+
/** Agent profile id (settings.agents); falls back to settings.chatAgent. */
|
|
20
|
+
agent_profile?: string;
|
|
21
|
+
session_title_template?: string;
|
|
22
|
+
message_template: string;
|
|
23
|
+
/** Append every item to one session vs fresh session per item. */
|
|
24
|
+
reuse_session?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Mode:
|
|
27
|
+
* 'per-item' (default) — one chat message per new item; message_template
|
|
28
|
+
* uses {{item.X}} placeholders.
|
|
29
|
+
* 'summary' — ALL new items in this tick are bundled into a
|
|
30
|
+
* single message; message_template gets
|
|
31
|
+
* {{items}} (JSON array) + {{items_text}} (one
|
|
32
|
+
* per line) + {{count}}. Lets the LLM analyze
|
|
33
|
+
* + summarize whatever you want.
|
|
34
|
+
*/
|
|
35
|
+
mode?: 'per-item' | 'summary';
|
|
36
|
+
/**
|
|
37
|
+
* Where the message lands:
|
|
38
|
+
* 'main' (default for summary) — append into the user's persistent main
|
|
39
|
+
* chat session. Triggers the agent
|
|
40
|
+
* loop in the user's active sidepanel.
|
|
41
|
+
* 'new' (default for per-item) — fresh temp session each tick (or
|
|
42
|
+
* reused if reuse_session=true).
|
|
43
|
+
*/
|
|
44
|
+
target?: 'main' | 'new';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type DispatchParams = PipelineDispatchParams | ChatDispatchParams;
|
|
48
|
+
|
|
49
|
+
export interface Job {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
schedule_interval_minutes: number;
|
|
54
|
+
|
|
55
|
+
source_connector: string;
|
|
56
|
+
source_tool: string;
|
|
57
|
+
source_input: Record<string, unknown>;
|
|
58
|
+
|
|
59
|
+
items_path: string; // '' = whole result if array
|
|
60
|
+
dedup_field: string;
|
|
61
|
+
|
|
62
|
+
dispatch_type: DispatchType;
|
|
63
|
+
dispatch_params: DispatchParams;
|
|
64
|
+
|
|
65
|
+
last_run_at: string | null;
|
|
66
|
+
next_run_at: string | null;
|
|
67
|
+
created_at: string;
|
|
68
|
+
updated_at: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface JobRun {
|
|
72
|
+
id: string;
|
|
73
|
+
job_id: string;
|
|
74
|
+
started_at: string;
|
|
75
|
+
finished_at: string | null;
|
|
76
|
+
status: JobRunStatus;
|
|
77
|
+
items_seen: number;
|
|
78
|
+
items_new: number;
|
|
79
|
+
items_dispatched: number;
|
|
80
|
+
error: string | null;
|
|
81
|
+
trigger: JobRunTrigger;
|
|
82
|
+
/** Diagnostic note set by the scheduler — backfill summary, missing-path hint, etc. */
|
|
83
|
+
notes: string | null;
|
|
84
|
+
/** Plain-text execution log for this tick (timestamped lines). */
|
|
85
|
+
log: string | null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface JobDispatch {
|
|
89
|
+
id: string;
|
|
90
|
+
job_run_id: string;
|
|
91
|
+
item_key: string;
|
|
92
|
+
item_preview: string | null;
|
|
93
|
+
dispatch_type: DispatchType;
|
|
94
|
+
dispatch_target_id: string | null;
|
|
95
|
+
status: JobDispatchStatus;
|
|
96
|
+
error: string | null;
|
|
97
|
+
created_at: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface CreateJobInput {
|
|
101
|
+
name: string;
|
|
102
|
+
enabled?: boolean;
|
|
103
|
+
schedule_interval_minutes?: number;
|
|
104
|
+
|
|
105
|
+
source_connector: string;
|
|
106
|
+
source_tool: string;
|
|
107
|
+
source_input?: Record<string, unknown>;
|
|
108
|
+
|
|
109
|
+
items_path?: string;
|
|
110
|
+
dedup_field: string;
|
|
111
|
+
|
|
112
|
+
dispatch_type: DispatchType;
|
|
113
|
+
dispatch_params: DispatchParams;
|
|
114
|
+
|
|
115
|
+
/** Default true: first tick records existing items as seen without dispatching. */
|
|
116
|
+
mark_existing_as_seen?: boolean;
|
|
117
|
+
}
|
|
@@ -17,12 +17,7 @@ import { execSync } from 'node:child_process';
|
|
|
17
17
|
|
|
18
18
|
function db() { return getDb(getDbPath()); }
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
function toIsoUTC(s: string | null): string | null {
|
|
22
|
-
if (!s) return null;
|
|
23
|
-
if (/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(s)) return s.replace(' ', 'T') + 'Z';
|
|
24
|
-
return s;
|
|
25
|
-
}
|
|
20
|
+
import { toIsoUTC } from './iso-time';
|
|
26
21
|
|
|
27
22
|
export interface ProjectPipelineBinding {
|
|
28
23
|
id: number;
|