@h-rig/server 0.0.6-alpha.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/README.md +14 -0
- package/dist/src/bootstrap.js +161 -0
- package/dist/src/index.js +13153 -0
- package/dist/src/inspector/agent-runtime.js +1077 -0
- package/dist/src/inspector/analysis.js +41 -0
- package/dist/src/inspector/discovery.js +137 -0
- package/dist/src/inspector/journal.js +518 -0
- package/dist/src/inspector/mission.js +562 -0
- package/dist/src/inspector/prompt.js +97 -0
- package/dist/src/inspector/provider-session.js +65 -0
- package/dist/src/inspector/reconcile.js +118 -0
- package/dist/src/inspector/review.js +13 -0
- package/dist/src/inspector/service.js +1759 -0
- package/dist/src/inspector/skills.js +155 -0
- package/dist/src/inspector/tools.js +1592 -0
- package/dist/src/inspector/types.js +1 -0
- package/dist/src/inspector/upstream-sync.js +479 -0
- package/dist/src/orchestration.js +402 -0
- package/dist/src/remote.js +123 -0
- package/dist/src/scheduler.js +84 -0
- package/dist/src/server-helpers/broadcasters.js +161 -0
- package/dist/src/server-helpers/conversation-snapshot.js +382 -0
- package/dist/src/server-helpers/event-emitter.js +41 -0
- package/dist/src/server-helpers/github-auth-store.js +155 -0
- package/dist/src/server-helpers/github-credentials.js +38 -0
- package/dist/src/server-helpers/github-project-status-sync.js +196 -0
- package/dist/src/server-helpers/github-projects.js +147 -0
- package/dist/src/server-helpers/github-reconciler.js +89 -0
- package/dist/src/server-helpers/http-router.js +3781 -0
- package/dist/src/server-helpers/http-utils.js +135 -0
- package/dist/src/server-helpers/inspector-agent-lifecycle.js +104 -0
- package/dist/src/server-helpers/inspector-jobs.js +4145 -0
- package/dist/src/server-helpers/issue-analysis.js +362 -0
- package/dist/src/server-helpers/normalizers.js +31 -0
- package/dist/src/server-helpers/notifications.js +96 -0
- package/dist/src/server-helpers/orchestration-ops.js +287 -0
- package/dist/src/server-helpers/orchestration.js +39 -0
- package/dist/src/server-helpers/plugin-host-cache.js +86 -0
- package/dist/src/server-helpers/project-fs-ops.js +194 -0
- package/dist/src/server-helpers/project-registry.js +124 -0
- package/dist/src/server-helpers/queue-state.js +78 -0
- package/dist/src/server-helpers/remote-checkout.js +140 -0
- package/dist/src/server-helpers/remote-snapshots.js +119 -0
- package/dist/src/server-helpers/run-io.js +262 -0
- package/dist/src/server-helpers/run-mutations.js +1784 -0
- package/dist/src/server-helpers/run-steering.js +176 -0
- package/dist/src/server-helpers/run-writers.js +75 -0
- package/dist/src/server-helpers/server-paths.js +27 -0
- package/dist/src/server-helpers/snapshot-orchestrator.js +832 -0
- package/dist/src/server-helpers/snapshot-service.js +1143 -0
- package/dist/src/server-helpers/summaries.js +126 -0
- package/dist/src/server-helpers/task-config.js +50 -0
- package/dist/src/server-helpers/task-projection.js +98 -0
- package/dist/src/server-helpers/terminal-runtime.js +156 -0
- package/dist/src/server-helpers/terminal-sessions.js +22 -0
- package/dist/src/server-helpers/validation-failure.js +31 -0
- package/dist/src/server-helpers/ws-router.js +1308 -0
- package/dist/src/server.js +12628 -0
- package/dist/src/websocket.js +63 -0
- package/package.json +33 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/server/src/inspector/skills.ts
|
|
3
|
+
var UNIVERSAL_REQUIRED_SKILLS = [
|
|
4
|
+
{
|
|
5
|
+
name: "test-driven-development",
|
|
6
|
+
rationale: "Write failing tests first for code and behavior changes unless a narrow exception is recorded."
|
|
7
|
+
}
|
|
8
|
+
];
|
|
9
|
+
var INSPECTOR_REQUIRED_SKILLS = [
|
|
10
|
+
{
|
|
11
|
+
name: "verification-before-completion",
|
|
12
|
+
rationale: "Do not claim completion or stability without direct verification evidence."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: "no-bs",
|
|
16
|
+
rationale: "Respect the machine no-bs gates, keep evidence up to date, and do not stop early."
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
var UNIVERSAL_RECOMMENDED_SKILLS = [
|
|
20
|
+
{
|
|
21
|
+
name: "verification-before-completion",
|
|
22
|
+
rationale: "Gather direct evidence before claiming a repair, review result, or task completion."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: "systematic-debugging",
|
|
26
|
+
rationale: "Use disciplined debugging when a run, harness path, or validator fails."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "dispatching-parallel-agents",
|
|
30
|
+
rationale: "Split independent analysis and review work when that shortens the critical path."
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "subagent-driven-development",
|
|
34
|
+
rationale: "Delegate bounded work to specialist subagents while keeping one context owner."
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "requesting-code-review",
|
|
38
|
+
rationale: "Run local review before landing meaningful implementation work."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "receiving-code-review",
|
|
42
|
+
rationale: "Handle review feedback rigorously instead of applying it blindly."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "using-git-worktrees",
|
|
46
|
+
rationale: "Use isolated worktrees for risky or parallel implementation branches."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "writing-plans",
|
|
50
|
+
rationale: "Plan multi-step changes explicitly when the work is broad or risky."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "executing-plans",
|
|
54
|
+
rationale: "Execute validated plans in a staged, reviewable way."
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "writing-skills",
|
|
58
|
+
rationale: "Improve or add agent skills when the harness needs new reusable behavior."
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "find-skills",
|
|
62
|
+
rationale: "Discover existing local skills before inventing new workflows."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "openai-docs",
|
|
66
|
+
rationale: "Use primary OpenAI documentation when the inspector needs current provider facts."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "linear",
|
|
70
|
+
rationale: "Create or update follow-up work in the task tracker when oversight detects needed action."
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "playwright",
|
|
74
|
+
rationale: "Inspect browser flows directly when a run touches web behavior or UI verification."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: "playwright-interactive",
|
|
78
|
+
rationale: "Keep a live browser session when iterative UI inspection is more efficient than restarts."
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
var INSPECTOR_ONLY_RECOMMENDED_SKILLS = [
|
|
82
|
+
{
|
|
83
|
+
name: "vercel:agent-browser",
|
|
84
|
+
rationale: "Perform high-fidelity browser inspection when a run or preview needs interactive verification."
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "vercel:agent-browser-verify",
|
|
88
|
+
rationale: "Run an automated visual gut-check against dev servers and previews."
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "vercel:verification",
|
|
92
|
+
rationale: "Verify end-to-end browser to API behavior when the change spans multiple surfaces."
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: "vercel:investigation-mode",
|
|
96
|
+
rationale: "Triages broken or stuck flows systematically when the harness or a preview misbehaves."
|
|
97
|
+
}
|
|
98
|
+
];
|
|
99
|
+
function uniqueSkills(skills) {
|
|
100
|
+
const seen = new Set;
|
|
101
|
+
const deduped = [];
|
|
102
|
+
for (const skill of skills) {
|
|
103
|
+
if (seen.has(skill.name)) {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
seen.add(skill.name);
|
|
107
|
+
deduped.push(skill);
|
|
108
|
+
}
|
|
109
|
+
return deduped;
|
|
110
|
+
}
|
|
111
|
+
function buildInspectorSkillCatalog(options) {
|
|
112
|
+
const required = [...UNIVERSAL_REQUIRED_SKILLS];
|
|
113
|
+
const recommended = [...UNIVERSAL_RECOMMENDED_SKILLS];
|
|
114
|
+
if (options.role === "inspector") {
|
|
115
|
+
required.push(...INSPECTOR_REQUIRED_SKILLS);
|
|
116
|
+
recommended.push(...INSPECTOR_ONLY_RECOMMENDED_SKILLS);
|
|
117
|
+
} else if (options.role === "reviewer") {
|
|
118
|
+
recommended.push({
|
|
119
|
+
name: "receiving-code-review",
|
|
120
|
+
rationale: "Review lanes should reason about findings carefully and defensibly."
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
if (options.taskKind === "bugfix") {
|
|
124
|
+
recommended.push({
|
|
125
|
+
name: "systematic-debugging",
|
|
126
|
+
rationale: "Bugfix work should start from a disciplined failure-class analysis."
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
required: uniqueSkills(required),
|
|
131
|
+
recommended: uniqueSkills(recommended)
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function buildSkillProvisioningDecision(options) {
|
|
135
|
+
const exceptionRecorded = Boolean(options.exception);
|
|
136
|
+
const catalog = buildInspectorSkillCatalog({
|
|
137
|
+
role: options.role,
|
|
138
|
+
taskKind: options.taskKind
|
|
139
|
+
});
|
|
140
|
+
const requiredSkills = catalog.required.map((skill) => skill.name);
|
|
141
|
+
const preferredSkills = catalog.recommended.map((skill) => skill.name);
|
|
142
|
+
return {
|
|
143
|
+
role: options.role,
|
|
144
|
+
taskKind: options.taskKind,
|
|
145
|
+
requiredSkills,
|
|
146
|
+
preferredSkills,
|
|
147
|
+
tddMode: exceptionRecorded ? "exception-recorded" : "required",
|
|
148
|
+
exceptionRecorded,
|
|
149
|
+
exception: options.exception ?? null
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
export {
|
|
153
|
+
buildSkillProvisioningDecision,
|
|
154
|
+
buildInspectorSkillCatalog
|
|
155
|
+
};
|