@synctek/forgeos 2.0.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/LICENSE +21 -0
- package/README.md +386 -0
- package/dist/cli/commands/analyze.d.ts +14 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +94 -0
- package/dist/cli/commands/analyze.js.map +1 -0
- package/dist/cli/commands/build.d.ts +11 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/build.js +86 -0
- package/dist/cli/commands/build.js.map +1 -0
- package/dist/cli/commands/changeset.d.ts +13 -0
- package/dist/cli/commands/changeset.d.ts.map +1 -0
- package/dist/cli/commands/changeset.js +174 -0
- package/dist/cli/commands/changeset.js.map +1 -0
- package/dist/cli/commands/evidence.d.ts +12 -0
- package/dist/cli/commands/evidence.d.ts.map +1 -0
- package/dist/cli/commands/evidence.js +94 -0
- package/dist/cli/commands/evidence.js.map +1 -0
- package/dist/cli/commands/federation.d.ts +13 -0
- package/dist/cli/commands/federation.d.ts.map +1 -0
- package/dist/cli/commands/federation.js +127 -0
- package/dist/cli/commands/federation.js.map +1 -0
- package/dist/cli/commands/gate.d.ts +15 -0
- package/dist/cli/commands/gate.d.ts.map +1 -0
- package/dist/cli/commands/gate.js +178 -0
- package/dist/cli/commands/gate.js.map +1 -0
- package/dist/cli/commands/initiative.d.ts +13 -0
- package/dist/cli/commands/initiative.d.ts.map +1 -0
- package/dist/cli/commands/initiative.js +130 -0
- package/dist/cli/commands/initiative.js.map +1 -0
- package/dist/cli/commands/mind.d.ts +16 -0
- package/dist/cli/commands/mind.d.ts.map +1 -0
- package/dist/cli/commands/mind.js +139 -0
- package/dist/cli/commands/mind.js.map +1 -0
- package/dist/cli/commands/outcome.d.ts +12 -0
- package/dist/cli/commands/outcome.d.ts.map +1 -0
- package/dist/cli/commands/outcome.js +85 -0
- package/dist/cli/commands/outcome.js.map +1 -0
- package/dist/cli/commands/project.d.ts +13 -0
- package/dist/cli/commands/project.d.ts.map +1 -0
- package/dist/cli/commands/project.js +128 -0
- package/dist/cli/commands/project.js.map +1 -0
- package/dist/cli/commands/review.d.ts +15 -0
- package/dist/cli/commands/review.d.ts.map +1 -0
- package/dist/cli/commands/review.js +167 -0
- package/dist/cli/commands/review.js.map +1 -0
- package/dist/cli/commands/score.d.ts +17 -0
- package/dist/cli/commands/score.d.ts.map +1 -0
- package/dist/cli/commands/score.js +168 -0
- package/dist/cli/commands/score.js.map +1 -0
- package/dist/cli/commands/session.d.ts +13 -0
- package/dist/cli/commands/session.d.ts.map +1 -0
- package/dist/cli/commands/session.js +133 -0
- package/dist/cli/commands/session.js.map +1 -0
- package/dist/cli/commands/trust.d.ts +16 -0
- package/dist/cli/commands/trust.d.ts.map +1 -0
- package/dist/cli/commands/trust.js +261 -0
- package/dist/cli/commands/trust.js.map +1 -0
- package/dist/cli/index.d.ts +19 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +99 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/output.d.ts +48 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +139 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/client.d.ts +46 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +146 -0
- package/dist/client.js.map +1 -0
- package/dist/handlers.d.ts +11 -0
- package/dist/handlers.d.ts.map +1 -0
- package/dist/handlers.js +424 -0
- package/dist/handlers.js.map +1 -0
- package/dist/http-server.d.ts +25 -0
- package/dist/http-server.d.ts.map +1 -0
- package/dist/http-server.js +246 -0
- package/dist/http-server.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/handlers.d.ts +11 -0
- package/dist/mcp/handlers.d.ts.map +1 -0
- package/dist/mcp/handlers.js +553 -0
- package/dist/mcp/handlers.js.map +1 -0
- package/dist/mcp/http-server.d.ts +25 -0
- package/dist/mcp/http-server.d.ts.map +1 -0
- package/dist/mcp/http-server.js +246 -0
- package/dist/mcp/http-server.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +40 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/tools.d.ts +944 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +531 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/shared/client.d.ts +59 -0
- package/dist/shared/client.d.ts.map +1 -0
- package/dist/shared/client.js +171 -0
- package/dist/shared/client.js.map +1 -0
- package/dist/shared/errors.d.ts +25 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +44 -0
- package/dist/shared/errors.js.map +1 -0
- package/dist/shared/types.d.ts +111 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +10 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/tools.d.ts +944 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +513 -0
- package/dist/tools.js.map +1 -0
- package/dist/trust/chain.d.ts +86 -0
- package/dist/trust/chain.d.ts.map +1 -0
- package/dist/trust/chain.js +176 -0
- package/dist/trust/chain.js.map +1 -0
- package/dist/trust/git-binding.d.ts +61 -0
- package/dist/trust/git-binding.d.ts.map +1 -0
- package/dist/trust/git-binding.js +133 -0
- package/dist/trust/git-binding.js.map +1 -0
- package/dist/trust/index.d.ts +20 -0
- package/dist/trust/index.d.ts.map +1 -0
- package/dist/trust/index.js +17 -0
- package/dist/trust/index.js.map +1 -0
- package/dist/trust/ledger.d.ts +144 -0
- package/dist/trust/ledger.d.ts.map +1 -0
- package/dist/trust/ledger.js +351 -0
- package/dist/trust/ledger.js.map +1 -0
- package/dist/trust/signing.d.ts +134 -0
- package/dist/trust/signing.d.ts.map +1 -0
- package/dist/trust/signing.js +249 -0
- package/dist/trust/signing.js.map +1 -0
- package/dist/trust/transmission.d.ts +129 -0
- package/dist/trust/transmission.d.ts.map +1 -0
- package/dist/trust/transmission.js +390 -0
- package/dist/trust/transmission.js.map +1 -0
- package/dist/types.d.ts +183 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAshBjB,CAAC"}
|
package/dist/tools.js
ADDED
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
export const TOOLS = [
|
|
2
|
+
{
|
|
3
|
+
name: "forge_init",
|
|
4
|
+
description: "Initialize a ForgeOS governance session. Returns project state, active work, governance rules, workflow runbook, and setup scorecard so you know immediately what steps remain.",
|
|
5
|
+
inputSchema: {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
project_id: {
|
|
9
|
+
type: "string",
|
|
10
|
+
description: "Project ID to initialize",
|
|
11
|
+
},
|
|
12
|
+
developer_id: {
|
|
13
|
+
type: "string",
|
|
14
|
+
description: "Developer identifier (default: local)",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
required: ["project_id"],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "forge_create_initiative",
|
|
22
|
+
description: "Create a new initiative to track a piece of work. Returns the initiative with a generated ID.",
|
|
23
|
+
inputSchema: {
|
|
24
|
+
type: "object",
|
|
25
|
+
properties: {
|
|
26
|
+
project_id: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "Project ID",
|
|
29
|
+
},
|
|
30
|
+
title: {
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "Initiative title",
|
|
33
|
+
},
|
|
34
|
+
description: {
|
|
35
|
+
type: "string",
|
|
36
|
+
description: "What this initiative accomplishes",
|
|
37
|
+
},
|
|
38
|
+
priority: {
|
|
39
|
+
type: "string",
|
|
40
|
+
enum: ["low", "medium", "high", "critical"],
|
|
41
|
+
description: "Priority level",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
required: ["project_id", "title", "description"],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "forge_propose_changeset",
|
|
49
|
+
description: "Propose a changeset for an initiative. Engine computes risk score and determines required gates, roles, and evidence. Returns changeset with risk profile, gate pipeline, and an immediate gate recommendation so you have the full risk analysis in one call.",
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
project_id: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Project ID",
|
|
56
|
+
},
|
|
57
|
+
initiative_id: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "Initiative this changeset belongs to",
|
|
60
|
+
},
|
|
61
|
+
description: {
|
|
62
|
+
type: "string",
|
|
63
|
+
description: "What changed and why",
|
|
64
|
+
},
|
|
65
|
+
files_changed: {
|
|
66
|
+
type: "array",
|
|
67
|
+
items: { type: "string" },
|
|
68
|
+
description: "File paths that changed",
|
|
69
|
+
},
|
|
70
|
+
modules_affected: {
|
|
71
|
+
type: "array",
|
|
72
|
+
items: { type: "string" },
|
|
73
|
+
description: "Module/area names affected",
|
|
74
|
+
},
|
|
75
|
+
branch: {
|
|
76
|
+
type: "string",
|
|
77
|
+
description: "Git branch name (optional)",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
required: [
|
|
81
|
+
"project_id",
|
|
82
|
+
"initiative_id",
|
|
83
|
+
"description",
|
|
84
|
+
"files_changed",
|
|
85
|
+
"modules_affected",
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "forge_get_profile",
|
|
91
|
+
description: "Fetch a reviewer persona profile for local subagent injection. If project context is provided, the profile is enriched with Shared Mind patterns. Use the returned system_prompt as the subagent's instructions.",
|
|
92
|
+
inputSchema: {
|
|
93
|
+
type: "object",
|
|
94
|
+
properties: {
|
|
95
|
+
role: {
|
|
96
|
+
type: "string",
|
|
97
|
+
enum: [
|
|
98
|
+
"architect",
|
|
99
|
+
"qa_test",
|
|
100
|
+
"security",
|
|
101
|
+
"performance",
|
|
102
|
+
"reliability",
|
|
103
|
+
"accessibility",
|
|
104
|
+
"docs_release",
|
|
105
|
+
],
|
|
106
|
+
description: "Quality review role",
|
|
107
|
+
},
|
|
108
|
+
project_id: {
|
|
109
|
+
type: "string",
|
|
110
|
+
description: "Project ID for contextualization (optional)",
|
|
111
|
+
},
|
|
112
|
+
team_id: {
|
|
113
|
+
type: "string",
|
|
114
|
+
description: "Team ID for Shared Mind context (default: default)",
|
|
115
|
+
},
|
|
116
|
+
modules_affected: {
|
|
117
|
+
type: "array",
|
|
118
|
+
items: { type: "string" },
|
|
119
|
+
description: "Modules to focus on",
|
|
120
|
+
},
|
|
121
|
+
files_changed: {
|
|
122
|
+
type: "array",
|
|
123
|
+
items: { type: "string" },
|
|
124
|
+
description: "Files to focus on",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
required: ["role"],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "forge_submit_evidence",
|
|
132
|
+
description: "Submit evidence (test results, scan outputs, etc.) for a changeset. Auto-populates gate evidence requirements.",
|
|
133
|
+
inputSchema: {
|
|
134
|
+
type: "object",
|
|
135
|
+
properties: {
|
|
136
|
+
project_id: {
|
|
137
|
+
type: "string",
|
|
138
|
+
description: "Project ID",
|
|
139
|
+
},
|
|
140
|
+
changeset_id: {
|
|
141
|
+
type: "string",
|
|
142
|
+
description: "Changeset ID",
|
|
143
|
+
},
|
|
144
|
+
type: {
|
|
145
|
+
type: "string",
|
|
146
|
+
enum: [
|
|
147
|
+
"unit_test",
|
|
148
|
+
"coverage",
|
|
149
|
+
"lint",
|
|
150
|
+
"security_scan",
|
|
151
|
+
"benchmark",
|
|
152
|
+
"migration_plan",
|
|
153
|
+
"ux_snapshot",
|
|
154
|
+
"a11y_audit",
|
|
155
|
+
"ai_review",
|
|
156
|
+
],
|
|
157
|
+
description: "Evidence type",
|
|
158
|
+
},
|
|
159
|
+
summary: {
|
|
160
|
+
type: "string",
|
|
161
|
+
description: "Summary of the evidence",
|
|
162
|
+
},
|
|
163
|
+
file_refs: {
|
|
164
|
+
type: "array",
|
|
165
|
+
items: { type: "string" },
|
|
166
|
+
description: "File references (optional)",
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
required: ["project_id", "changeset_id", "type", "summary"],
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "forge_submit_review",
|
|
174
|
+
description: "Submit a complete review with findings and verdict. Creates and finalizes the review in one call.",
|
|
175
|
+
inputSchema: {
|
|
176
|
+
type: "object",
|
|
177
|
+
properties: {
|
|
178
|
+
project_id: {
|
|
179
|
+
type: "string",
|
|
180
|
+
description: "Project ID",
|
|
181
|
+
},
|
|
182
|
+
changeset_id: {
|
|
183
|
+
type: "string",
|
|
184
|
+
description: "Changeset ID",
|
|
185
|
+
},
|
|
186
|
+
role: {
|
|
187
|
+
type: "string",
|
|
188
|
+
description: "Review role (e.g. security, architect)",
|
|
189
|
+
},
|
|
190
|
+
status: {
|
|
191
|
+
type: "string",
|
|
192
|
+
enum: ["approved", "blocked", "pending"],
|
|
193
|
+
description: "Review verdict",
|
|
194
|
+
},
|
|
195
|
+
notes: {
|
|
196
|
+
type: "string",
|
|
197
|
+
description: "Review summary",
|
|
198
|
+
},
|
|
199
|
+
findings: {
|
|
200
|
+
type: "array",
|
|
201
|
+
items: {
|
|
202
|
+
type: "object",
|
|
203
|
+
properties: {
|
|
204
|
+
category: { type: "string" },
|
|
205
|
+
severity: {
|
|
206
|
+
type: "string",
|
|
207
|
+
enum: ["pass", "warning", "concern", "fail"],
|
|
208
|
+
},
|
|
209
|
+
observation: { type: "string" },
|
|
210
|
+
recommendation: { type: "string" },
|
|
211
|
+
},
|
|
212
|
+
required: ["category", "severity", "observation"],
|
|
213
|
+
},
|
|
214
|
+
description: "Structured findings from the review",
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
required: [
|
|
218
|
+
"project_id",
|
|
219
|
+
"changeset_id",
|
|
220
|
+
"role",
|
|
221
|
+
"status",
|
|
222
|
+
"notes",
|
|
223
|
+
"findings",
|
|
224
|
+
],
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
name: "forge_check_gates",
|
|
229
|
+
description: "Get the gate pipeline status for a changeset. Shows which gates are passed, pending, or failed, and what's needed to advance.",
|
|
230
|
+
inputSchema: {
|
|
231
|
+
type: "object",
|
|
232
|
+
properties: {
|
|
233
|
+
project_id: {
|
|
234
|
+
type: "string",
|
|
235
|
+
description: "Project ID",
|
|
236
|
+
},
|
|
237
|
+
changeset_id: {
|
|
238
|
+
type: "string",
|
|
239
|
+
description: "Changeset ID",
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
required: ["project_id", "changeset_id"],
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
name: "forge_promote_gate",
|
|
247
|
+
description: "Promote a gate to passed status. Requirements (evidence + roles) must be met. Advances the pipeline to the next gate.",
|
|
248
|
+
inputSchema: {
|
|
249
|
+
type: "object",
|
|
250
|
+
properties: {
|
|
251
|
+
project_id: {
|
|
252
|
+
type: "string",
|
|
253
|
+
description: "Project ID",
|
|
254
|
+
},
|
|
255
|
+
changeset_id: {
|
|
256
|
+
type: "string",
|
|
257
|
+
description: "Changeset ID",
|
|
258
|
+
},
|
|
259
|
+
gate_id: {
|
|
260
|
+
type: "string",
|
|
261
|
+
enum: [
|
|
262
|
+
"intent",
|
|
263
|
+
"design",
|
|
264
|
+
"implementation",
|
|
265
|
+
"verification",
|
|
266
|
+
"hardening",
|
|
267
|
+
"release",
|
|
268
|
+
],
|
|
269
|
+
description: "Gate to promote",
|
|
270
|
+
},
|
|
271
|
+
promoted_by: {
|
|
272
|
+
type: "string",
|
|
273
|
+
description: "Who is promoting (default: local_agent)",
|
|
274
|
+
},
|
|
275
|
+
},
|
|
276
|
+
required: ["project_id", "changeset_id", "gate_id"],
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: "forge_release_check",
|
|
281
|
+
description: "Check if a changeset is ready to release. Returns can_release status and any remaining blockers.",
|
|
282
|
+
inputSchema: {
|
|
283
|
+
type: "object",
|
|
284
|
+
properties: {
|
|
285
|
+
project_id: {
|
|
286
|
+
type: "string",
|
|
287
|
+
description: "Project ID",
|
|
288
|
+
},
|
|
289
|
+
changeset_id: {
|
|
290
|
+
type: "string",
|
|
291
|
+
description: "Changeset ID",
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
required: ["project_id", "changeset_id"],
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: "forge_query_mind",
|
|
299
|
+
description: "Search the Shared Mind for institutional knowledge. Returns patterns, anti-patterns, and lessons relevant to the context.",
|
|
300
|
+
inputSchema: {
|
|
301
|
+
type: "object",
|
|
302
|
+
properties: {
|
|
303
|
+
team_id: {
|
|
304
|
+
type: "string",
|
|
305
|
+
description: "Team ID (default: default)",
|
|
306
|
+
},
|
|
307
|
+
context: {
|
|
308
|
+
type: "string",
|
|
309
|
+
description: "Search context (keywords, module names, etc.)",
|
|
310
|
+
},
|
|
311
|
+
domain: {
|
|
312
|
+
type: "string",
|
|
313
|
+
description: "Specific domain to search (optional)",
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
required: ["context"],
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
name: "forge_observe",
|
|
321
|
+
description: "Record an observation to the Shared Mind. Use when you discover patterns, anti-patterns, or lessons during development.",
|
|
322
|
+
inputSchema: {
|
|
323
|
+
type: "object",
|
|
324
|
+
properties: {
|
|
325
|
+
team_id: {
|
|
326
|
+
type: "string",
|
|
327
|
+
description: "Team ID (default: default)",
|
|
328
|
+
},
|
|
329
|
+
domain: {
|
|
330
|
+
type: "string",
|
|
331
|
+
description: "Knowledge domain (e.g. module name, technology)",
|
|
332
|
+
},
|
|
333
|
+
observation_type: {
|
|
334
|
+
type: "string",
|
|
335
|
+
enum: [
|
|
336
|
+
"pattern",
|
|
337
|
+
"anti-pattern",
|
|
338
|
+
"fix-recipe",
|
|
339
|
+
"architecture-decision",
|
|
340
|
+
"lesson",
|
|
341
|
+
],
|
|
342
|
+
description: "Type of observation",
|
|
343
|
+
},
|
|
344
|
+
content: {
|
|
345
|
+
type: "string",
|
|
346
|
+
description: "What was observed",
|
|
347
|
+
},
|
|
348
|
+
confidence: {
|
|
349
|
+
type: "number",
|
|
350
|
+
description: "Confidence 0.0-1.0 (default: 0.8)",
|
|
351
|
+
},
|
|
352
|
+
tags: {
|
|
353
|
+
type: "array",
|
|
354
|
+
items: { type: "string" },
|
|
355
|
+
description: "Tags for categorization",
|
|
356
|
+
},
|
|
357
|
+
},
|
|
358
|
+
required: ["domain", "observation_type", "content"],
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
name: "forge_get_workflow",
|
|
363
|
+
description: "Get the current workflow state for an initiative. Shows which step the developer is on, what's needed next, and overall progress.",
|
|
364
|
+
inputSchema: {
|
|
365
|
+
type: "object",
|
|
366
|
+
properties: {
|
|
367
|
+
initiative_id: {
|
|
368
|
+
type: "string",
|
|
369
|
+
description: "Initiative ID",
|
|
370
|
+
},
|
|
371
|
+
},
|
|
372
|
+
required: ["initiative_id"],
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
name: "forge_create_project",
|
|
377
|
+
description: "Create a new ForgeOS project. Projects are the top-level container for initiatives, changesets, and governance workflows.",
|
|
378
|
+
inputSchema: {
|
|
379
|
+
type: "object",
|
|
380
|
+
properties: {
|
|
381
|
+
name: {
|
|
382
|
+
type: "string",
|
|
383
|
+
description: "Project name (e.g., 'my-saas-app', 'mobile-backend')",
|
|
384
|
+
},
|
|
385
|
+
description: {
|
|
386
|
+
type: "string",
|
|
387
|
+
description: "Brief description of the project",
|
|
388
|
+
},
|
|
389
|
+
platform: {
|
|
390
|
+
type: "string",
|
|
391
|
+
enum: ["web", "mobile", "api", "cli", "desktop", "other"],
|
|
392
|
+
description: "Target platform (e.g., 'web', 'mobile', 'api', 'cli')",
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
required: ["name"],
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: "forge_quickstart",
|
|
400
|
+
description: "Create a sandbox project and run a complete governance cycle in seconds. Perfect for first-time setup and testing. Returns the full report including project, initiative, changeset, gates, and next steps.",
|
|
401
|
+
inputSchema: {
|
|
402
|
+
type: "object",
|
|
403
|
+
properties: {},
|
|
404
|
+
required: [],
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
name: "forge_discover",
|
|
409
|
+
description: "Analyze your repository and get a recommended governance configuration based on your tech stack. Returns recommended preset, template, evidence mapping, and CI hints.",
|
|
410
|
+
inputSchema: {
|
|
411
|
+
type: "object",
|
|
412
|
+
properties: {
|
|
413
|
+
languages: {
|
|
414
|
+
type: "array",
|
|
415
|
+
items: { type: "string" },
|
|
416
|
+
description: "Programming languages detected in the repo (e.g. ['typescript', 'python'])",
|
|
417
|
+
},
|
|
418
|
+
ci_tools: {
|
|
419
|
+
type: "array",
|
|
420
|
+
items: { type: "string" },
|
|
421
|
+
description: "CI/CD tools in use (e.g. ['github-actions', 'circleci'])",
|
|
422
|
+
},
|
|
423
|
+
test_frameworks: {
|
|
424
|
+
type: "array",
|
|
425
|
+
items: { type: "string" },
|
|
426
|
+
description: "Testing frameworks detected (e.g. ['jest', 'pytest'])",
|
|
427
|
+
},
|
|
428
|
+
team_size: {
|
|
429
|
+
type: "number",
|
|
430
|
+
description: "Approximate team size (headcount)",
|
|
431
|
+
},
|
|
432
|
+
repo_type: {
|
|
433
|
+
type: "string",
|
|
434
|
+
description: "Type of repository (e.g. 'monorepo', 'service', 'library', 'mobile-app')",
|
|
435
|
+
},
|
|
436
|
+
},
|
|
437
|
+
required: [],
|
|
438
|
+
},
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
name: "forge_get_presets",
|
|
442
|
+
description: "List available governance presets (Startup, Enterprise, Regulated, Mobile Release QA). Returns all presets with descriptions so you can choose the right gate template for your project.",
|
|
443
|
+
inputSchema: {
|
|
444
|
+
type: "object",
|
|
445
|
+
properties: {},
|
|
446
|
+
required: [],
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
name: "forge_configure_project_gates",
|
|
451
|
+
description: "Configure the governance gate template for a project. Use a preset name or provide a custom template. This sets which gates are required and what evidence is needed to advance.",
|
|
452
|
+
inputSchema: {
|
|
453
|
+
type: "object",
|
|
454
|
+
properties: {
|
|
455
|
+
project_id: {
|
|
456
|
+
type: "string",
|
|
457
|
+
description: "Project ID",
|
|
458
|
+
},
|
|
459
|
+
preset: {
|
|
460
|
+
type: "string",
|
|
461
|
+
description: "Preset name to apply (e.g. 'startup', 'enterprise', 'regulated', 'mobile_release_qa'). Mutually exclusive with custom_template.",
|
|
462
|
+
},
|
|
463
|
+
custom_template: {
|
|
464
|
+
type: "object",
|
|
465
|
+
description: "Custom gate template object. Mutually exclusive with preset.",
|
|
466
|
+
},
|
|
467
|
+
},
|
|
468
|
+
required: ["project_id"],
|
|
469
|
+
},
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: "forge_recommend_gates",
|
|
473
|
+
description: "Get a gate recommendation for a changeset based on risk analysis. Review the recommendation and configure gates accordingly. Returns risk analysis, recommended gates, minimum gates, and rationale.",
|
|
474
|
+
inputSchema: {
|
|
475
|
+
type: "object",
|
|
476
|
+
properties: {
|
|
477
|
+
project_id: {
|
|
478
|
+
type: "string",
|
|
479
|
+
description: "Project ID",
|
|
480
|
+
},
|
|
481
|
+
changeset_id: {
|
|
482
|
+
type: "string",
|
|
483
|
+
description: "Changeset ID to analyse",
|
|
484
|
+
},
|
|
485
|
+
},
|
|
486
|
+
required: ["project_id", "changeset_id"],
|
|
487
|
+
},
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
name: "forge_scorecard",
|
|
491
|
+
description: "Check your ForgeOS setup completeness. Shows which onboarding steps are done and what to do next. Use this to verify your environment is fully configured.",
|
|
492
|
+
inputSchema: {
|
|
493
|
+
type: "object",
|
|
494
|
+
properties: {},
|
|
495
|
+
required: [],
|
|
496
|
+
},
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
name: "forge_workflow_template",
|
|
500
|
+
description: "Get copy-paste workflow templates for common scenarios (bugfix, feature, hotfix, release candidate). Omit template_id to get all templates.",
|
|
501
|
+
inputSchema: {
|
|
502
|
+
type: "object",
|
|
503
|
+
properties: {
|
|
504
|
+
template_id: {
|
|
505
|
+
type: "string",
|
|
506
|
+
description: "Template ID to fetch (e.g. 'bugfix', 'feature', 'hotfix', 'release_candidate'). Omit to list all.",
|
|
507
|
+
},
|
|
508
|
+
},
|
|
509
|
+
required: [],
|
|
510
|
+
},
|
|
511
|
+
},
|
|
512
|
+
];
|
|
513
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB;QACE,IAAI,EAAE,YAAY;QAClB,WAAW,EACT,iLAAiL;QACnL,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,UAAU,EAAE;oBACV,IAAI,EAAE,QAAiB;oBACvB,WAAW,EAAE,0BAA0B;iBACxC;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,QAAiB;oBACvB,WAAW,EAAE,uCAAuC;iBACrD;aACF;YACD,QAAQ,EAAE,CAAC,YAAY,CAAC;SACzB;KACF;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,WAAW,EACT,+FAA+F;QACjG,WAAW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B;oBACvB,WAAW,EAAE,8DAA8D;iBAC5E;aACF;YACD,QAAQ,EAAE,CAAC,YAAY,CAAC;SACzB;KACF;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EACT,sMAAsM;QACxM,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,UAAU,EAAE;oBACV,IAAI,EAAE,QAAiB;oBACvB,WAAW,EAAE,YAAY;iBAC1B;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,QAAiB;oBACvB,WAAW,EAAE,yBAAyB;iBACvC;aACF;YACD,QAAQ,EAAE,CAAC,YAAY,EAAE,cAAc,CAAC;SACzC;KACF;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,WAAW,EACT,4JAA4J;QAC9J,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE,EAAE;YACd,QAAQ,EAAE,EAAE;SACb;KACF;IACD;QACE,IAAI,EAAE,yBAAyB;QAC/B,WAAW,EACT,6IAA6I;QAC/I,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,WAAW,EAAE;oBACX,IAAI,EAAE,QAAiB;oBACvB,WAAW,EAAE,mGAAmG;iBACjH;aACF;YACD,QAAQ,EAAE,EAAE;SACb;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hash-chain primitives for the ForgeOS Trust Ledger.
|
|
3
|
+
*
|
|
4
|
+
* Binary-compatible with the Python ledger.py implementation.
|
|
5
|
+
*
|
|
6
|
+
* Chain hash formula (matches Python _compute_chain_hash):
|
|
7
|
+
* chain_hash = SHA-256("{seq}:{prev_hash}:{payload_hash}:{timestamp}")
|
|
8
|
+
*
|
|
9
|
+
* Payload hash formula (matches Python _sha256_dict):
|
|
10
|
+
* payload_hash = SHA-256(JSON.stringify(payload, sortedKeys))
|
|
11
|
+
* where JSON uses ensure_ascii=false equivalent (UTF-8) and sort_keys=True.
|
|
12
|
+
*
|
|
13
|
+
* The genesis sentinel is "GENESIS" (matches Python GENESIS_SENTINEL),
|
|
14
|
+
* NOT a zero-filled hex string.
|
|
15
|
+
*/
|
|
16
|
+
/** Genesis sentinel value — used as prev_hash for the first entry. */
|
|
17
|
+
export declare const GENESIS_SENTINEL = "GENESIS";
|
|
18
|
+
/** Schema version constant matching the Python implementation. */
|
|
19
|
+
export declare const SCHEMA_VERSION = "1.0";
|
|
20
|
+
/** Valid entry types — must match Python ENTRY_TYPES (§5.3 of architecture spec). */
|
|
21
|
+
export declare const ENTRY_TYPES: Set<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Compute the chain hash for a ledger entry.
|
|
24
|
+
*
|
|
25
|
+
* Formula: SHA-256("{seq}:{prev_hash}:{payload_hash}:{timestamp}")
|
|
26
|
+
*
|
|
27
|
+
* This exactly replicates Python's:
|
|
28
|
+
* material = f"{seq}:{prev_hash}:{payload_hash}:{timestamp}"
|
|
29
|
+
* return hashlib.sha256(material.encode("utf-8")).hexdigest()
|
|
30
|
+
*
|
|
31
|
+
* @param seq - Zero-based integer sequence number of the entry.
|
|
32
|
+
* @param prevHash - chain_hash of the previous entry, or GENESIS_SENTINEL for seq 0.
|
|
33
|
+
* @param payloadHash - SHA-256 hex digest of the payload dict.
|
|
34
|
+
* @param timestamp - ISO 8601 UTC timestamp string.
|
|
35
|
+
* @returns 64-character hex SHA-256 digest.
|
|
36
|
+
*/
|
|
37
|
+
export declare function computeChainHash(seq: number, prevHash: string, payloadHash: string, timestamp: string): string;
|
|
38
|
+
/**
|
|
39
|
+
* Compute the payload hash for a ledger entry.
|
|
40
|
+
*
|
|
41
|
+
* Replicates Python's _sha256_dict:
|
|
42
|
+
* canonical = json.dumps(d, ensure_ascii=False, sort_keys=True)
|
|
43
|
+
* return hashlib.sha256(canonical.encode("utf-8")).hexdigest()
|
|
44
|
+
*
|
|
45
|
+
* Keys are sorted recursively at the top level only (matching Python's
|
|
46
|
+
* sort_keys=True which sorts only the top-level dict keys in standard
|
|
47
|
+
* json.dumps — nested dicts are sorted too since Python json.dumps
|
|
48
|
+
* sort_keys=True applies recursively).
|
|
49
|
+
*
|
|
50
|
+
* IMPORTANT: JSON.stringify with a replacer that sorts keys at every
|
|
51
|
+
* level is required for full binary compatibility with Python's
|
|
52
|
+
* json.dumps(..., sort_keys=True) which sorts ALL nested dict keys.
|
|
53
|
+
*
|
|
54
|
+
* @param payload - The payload dict to hash.
|
|
55
|
+
* @returns 64-character hex SHA-256 digest.
|
|
56
|
+
*/
|
|
57
|
+
export declare function computePayloadHash(payload: Record<string, unknown>): string;
|
|
58
|
+
/**
|
|
59
|
+
* JSON serialization matching Python's json.dumps(d, ensure_ascii=False, sort_keys=True).
|
|
60
|
+
*
|
|
61
|
+
* CRITICAL compatibility requirement:
|
|
62
|
+
* Python's json.dumps uses ": " (space after colon) and ", " (space after comma)
|
|
63
|
+
* as default separators. JavaScript's JSON.stringify uses ":" and "," (no spaces).
|
|
64
|
+
* For binary hash compatibility, we must reproduce Python's exact output.
|
|
65
|
+
*
|
|
66
|
+
* Python also sorts ALL dict keys recursively (sort_keys=True applies at every
|
|
67
|
+
* nesting level). JavaScript's JSON.stringify does not sort keys.
|
|
68
|
+
*
|
|
69
|
+
* Python's ensure_ascii=False means non-ASCII chars pass through unescaped.
|
|
70
|
+
* JavaScript's JSON.stringify also does not escape non-ASCII chars by default.
|
|
71
|
+
*
|
|
72
|
+
* This function produces output IDENTICAL to Python's json.dumps with those
|
|
73
|
+
* settings, enabling cross-language hash chain verification.
|
|
74
|
+
*
|
|
75
|
+
* @param value - Value to stringify.
|
|
76
|
+
* @returns JSON string matching Python's json.dumps output exactly.
|
|
77
|
+
*/
|
|
78
|
+
export declare function sortedJsonStringify(value: unknown): string;
|
|
79
|
+
/**
|
|
80
|
+
* Serialize value to JSON matching Python's json.dumps(ensure_ascii=False, sort_keys=True).
|
|
81
|
+
*
|
|
82
|
+
* Uses ": " after colons and ", " after commas — exactly Python's default separators.
|
|
83
|
+
* Sorts all object keys recursively. Does not escape non-ASCII characters.
|
|
84
|
+
*/
|
|
85
|
+
export declare function pythonJsonDumps(value: unknown): string;
|
|
86
|
+
//# sourceMappingURL=chain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../src/trust/chain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,sEAAsE;AACtE,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAE1C,kEAAkE;AAClE,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC,qFAAqF;AACrF,eAAO,MAAM,WAAW,aAQtB,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,MAAM,CAGR;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAG3E;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAE1D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAyBtD"}
|