@jeger-ai/opengantry 2.7.0 → 3.0.1
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/NOTICE +1 -0
- package/README.md +139 -326
- package/dist/cli/commands/arch.d.ts +2 -1
- package/dist/cli/commands/arch.d.ts.map +1 -1
- package/dist/cli/commands/arch.js +20 -9
- package/dist/cli/commands/arch.js.map +1 -1
- package/dist/cli/commands/blueprint.d.ts +7 -0
- package/dist/cli/commands/blueprint.d.ts.map +1 -0
- package/dist/cli/commands/blueprint.js +69 -0
- package/dist/cli/commands/blueprint.js.map +1 -0
- package/dist/cli/commands/init.d.ts +3 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +12 -0
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/lib/arch/cage/architecture-drift-doctor.d.ts +4 -0
- package/dist/cli/lib/arch/cage/architecture-drift-doctor.d.ts.map +1 -0
- package/dist/cli/lib/arch/cage/architecture-drift-doctor.js +58 -0
- package/dist/cli/lib/arch/cage/architecture-drift-doctor.js.map +1 -0
- package/dist/cli/lib/{target-architecture-doctor.d.ts → arch/cage/target-architecture-doctor.d.ts} +1 -1
- package/dist/cli/lib/arch/cage/target-architecture-doctor.d.ts.map +1 -0
- package/dist/cli/lib/arch/cage/target-architecture-doctor.js.map +1 -0
- package/dist/cli/lib/{target-architecture.d.ts → arch/cage/target-architecture.d.ts} +12 -3
- package/dist/cli/lib/arch/cage/target-architecture.d.ts.map +1 -0
- package/dist/cli/lib/{target-architecture.js → arch/cage/target-architecture.js} +121 -23
- package/dist/cli/lib/arch/cage/target-architecture.js.map +1 -0
- package/dist/cli/lib/arch/external/architecture-credential.d.ts.map +1 -0
- package/dist/cli/lib/{architecture-credential.js → arch/external/architecture-credential.js} +2 -2
- package/dist/cli/lib/arch/external/architecture-credential.js.map +1 -0
- package/dist/cli/lib/arch/external/architecture-fetch.d.ts.map +1 -0
- package/dist/cli/lib/{architecture-fetch.js → arch/external/architecture-fetch.js} +1 -1
- package/dist/cli/lib/arch/external/architecture-fetch.js.map +1 -0
- package/dist/cli/lib/{architecture-pointer.d.ts → arch/external/architecture-pointer.d.ts} +1 -1
- package/dist/cli/lib/arch/external/architecture-pointer.d.ts.map +1 -0
- package/dist/cli/lib/{architecture-pointer.js → arch/external/architecture-pointer.js} +2 -2
- package/dist/cli/lib/arch/external/architecture-pointer.js.map +1 -0
- package/dist/cli/lib/blueprint-engine.d.ts +22 -0
- package/dist/cli/lib/blueprint-engine.d.ts.map +1 -0
- package/dist/cli/lib/blueprint-engine.js +127 -0
- package/dist/cli/lib/blueprint-engine.js.map +1 -0
- package/dist/cli/lib/break-glass.d.ts +1 -1
- package/dist/cli/lib/break-glass.d.ts.map +1 -1
- package/dist/cli/lib/constants.d.ts +1 -0
- package/dist/cli/lib/constants.d.ts.map +1 -1
- package/dist/cli/lib/constants.js +1 -0
- package/dist/cli/lib/constants.js.map +1 -1
- package/dist/cli/lib/context-feed-remediation.d.ts +2 -2
- package/dist/cli/lib/context-feed-remediation.d.ts.map +1 -1
- package/dist/cli/lib/discovery-proposal.d.ts +19 -0
- package/dist/cli/lib/discovery-proposal.d.ts.map +1 -0
- package/dist/cli/lib/discovery-proposal.js +110 -0
- package/dist/cli/lib/discovery-proposal.js.map +1 -0
- package/dist/cli/lib/discovery-scanner.d.ts +11 -0
- package/dist/cli/lib/discovery-scanner.d.ts.map +1 -0
- package/dist/cli/lib/discovery-scanner.js +82 -0
- package/dist/cli/lib/discovery-scanner.js.map +1 -0
- package/dist/cli/lib/discovery-types.d.ts +40 -0
- package/dist/cli/lib/discovery-types.d.ts.map +1 -0
- package/dist/cli/lib/discovery-types.js +3 -0
- package/dist/cli/lib/discovery-types.js.map +1 -0
- package/dist/cli/lib/doctor-core.d.ts.map +1 -1
- package/dist/cli/lib/doctor-core.js +4 -2
- package/dist/cli/lib/doctor-core.js.map +1 -1
- package/dist/cli/lib/domains/domain-adapter.d.ts +40 -0
- package/dist/cli/lib/domains/domain-adapter.d.ts.map +1 -0
- package/dist/cli/lib/domains/domain-adapter.js +20 -0
- package/dist/cli/lib/domains/domain-adapter.js.map +1 -0
- package/dist/cli/lib/domains/domain-code.d.ts +3 -0
- package/dist/cli/lib/domains/domain-code.d.ts.map +1 -0
- package/dist/cli/lib/domains/domain-code.js +170 -0
- package/dist/cli/lib/domains/domain-code.js.map +1 -0
- package/dist/cli/lib/domains/domain-content.d.ts +3 -0
- package/dist/cli/lib/domains/domain-content.d.ts.map +1 -0
- package/dist/cli/lib/domains/domain-content.js +189 -0
- package/dist/cli/lib/domains/domain-content.js.map +1 -0
- package/dist/cli/lib/domains/index.d.ts +5 -0
- package/dist/cli/lib/domains/index.d.ts.map +1 -0
- package/dist/cli/lib/domains/index.js +16 -0
- package/dist/cli/lib/domains/index.js.map +1 -0
- package/dist/cli/lib/errors.d.ts +0 -6
- package/dist/cli/lib/errors.d.ts.map +1 -1
- package/dist/cli/lib/errors.js +0 -4
- package/dist/cli/lib/errors.js.map +1 -1
- package/dist/cli/lib/gxt-error-codes.d.ts +0 -2
- package/dist/cli/lib/gxt-error-codes.d.ts.map +1 -1
- package/dist/cli/lib/gxt-error-codes.js +0 -2
- package/dist/cli/lib/gxt-error-codes.js.map +1 -1
- package/dist/cli/lib/init-compose.d.ts +1 -1
- package/dist/cli/lib/init-compose.d.ts.map +1 -1
- package/dist/cli/lib/init-discover.d.ts +14 -0
- package/dist/cli/lib/init-discover.d.ts.map +1 -0
- package/dist/cli/lib/init-discover.js +45 -0
- package/dist/cli/lib/init-discover.js.map +1 -0
- package/dist/cli/lib/kpi-engine.d.ts +2 -2
- package/dist/cli/lib/kpi-engine.d.ts.map +1 -1
- package/dist/cli/lib/manifest.d.ts +1 -1
- package/dist/cli/lib/manifest.d.ts.map +1 -1
- package/dist/cli/lib/manifest.js +1 -1
- package/dist/cli/lib/manifest.js.map +1 -1
- package/dist/cli/lib/mcp-check-signature.d.ts +6 -0
- package/dist/cli/lib/mcp-check-signature.d.ts.map +1 -0
- package/dist/cli/lib/mcp-check-signature.js +40 -0
- package/dist/cli/lib/mcp-check-signature.js.map +1 -0
- package/dist/cli/lib/mcp-draft-legislation.d.ts +6 -0
- package/dist/cli/lib/mcp-draft-legislation.d.ts.map +1 -0
- package/dist/cli/lib/mcp-draft-legislation.js +63 -0
- package/dist/cli/lib/mcp-draft-legislation.js.map +1 -0
- package/dist/cli/lib/mcp-execute-legislation.d.ts +6 -0
- package/dist/cli/lib/mcp-execute-legislation.d.ts.map +1 -0
- package/dist/cli/lib/mcp-execute-legislation.js +53 -0
- package/dist/cli/lib/mcp-execute-legislation.js.map +1 -0
- package/dist/cli/lib/mcp-governance-shared.d.ts +119 -0
- package/dist/cli/lib/mcp-governance-shared.d.ts.map +1 -0
- package/dist/cli/lib/mcp-governance-shared.js +21 -0
- package/dist/cli/lib/mcp-governance-shared.js.map +1 -0
- package/dist/cli/lib/mcp-governance.d.ts +9 -121
- package/dist/cli/lib/mcp-governance.d.ts.map +1 -1
- package/dist/cli/lib/mcp-governance.js +8 -259
- package/dist/cli/lib/mcp-governance.js.map +1 -1
- package/dist/cli/lib/mcp-last-error.d.ts +3 -0
- package/dist/cli/lib/mcp-last-error.d.ts.map +1 -0
- package/dist/cli/lib/mcp-last-error.js +18 -0
- package/dist/cli/lib/mcp-last-error.js.map +1 -0
- package/dist/cli/lib/mcp-pin-mission.d.ts +6 -0
- package/dist/cli/lib/mcp-pin-mission.d.ts.map +1 -0
- package/dist/cli/lib/mcp-pin-mission.js +21 -0
- package/dist/cli/lib/mcp-pin-mission.js.map +1 -0
- package/dist/cli/lib/mcp-resolve-mission.d.ts +3 -0
- package/dist/cli/lib/mcp-resolve-mission.d.ts.map +1 -0
- package/dist/cli/lib/mcp-resolve-mission.js +18 -0
- package/dist/cli/lib/mcp-resolve-mission.js.map +1 -0
- package/dist/cli/lib/mcp-start-orchestration.d.ts +3 -0
- package/dist/cli/lib/mcp-start-orchestration.d.ts.map +1 -0
- package/dist/cli/lib/mcp-start-orchestration.js +53 -0
- package/dist/cli/lib/mcp-start-orchestration.js.map +1 -0
- package/dist/cli/lib/mcp-tools-register.d.ts.map +1 -1
- package/dist/cli/lib/mcp-tools-register.js +7 -1
- package/dist/cli/lib/mcp-tools-register.js.map +1 -1
- package/dist/cli/lib/path-glob.d.ts +8 -0
- package/dist/cli/lib/path-glob.d.ts.map +1 -0
- package/dist/cli/lib/path-glob.js +40 -0
- package/dist/cli/lib/path-glob.js.map +1 -0
- package/dist/cli/lib/perimeter.d.ts +1 -2
- package/dist/cli/lib/perimeter.d.ts.map +1 -1
- package/dist/cli/lib/perimeter.js +2 -10
- package/dist/cli/lib/perimeter.js.map +1 -1
- package/dist/cli/lib/surgeons/registry.d.ts +1 -1
- package/dist/cli/lib/surgeons/registry.d.ts.map +1 -1
- package/dist/cli/lib/trace-evidence.d.ts +21 -0
- package/dist/cli/lib/trace-evidence.d.ts.map +1 -0
- package/dist/cli/lib/trace-evidence.js +113 -0
- package/dist/cli/lib/trace-evidence.js.map +1 -0
- package/dist/cli/lib/trace-quote.d.ts +37 -0
- package/dist/cli/lib/trace-quote.d.ts.map +1 -0
- package/dist/cli/lib/trace-quote.js +177 -0
- package/dist/cli/lib/trace-quote.js.map +1 -0
- package/dist/cli/lib/trace-status.d.ts +7 -0
- package/dist/cli/lib/trace-status.d.ts.map +1 -0
- package/dist/cli/lib/trace-status.js +20 -0
- package/dist/cli/lib/trace-status.js.map +1 -0
- package/dist/cli/lib/trace.d.ts +3 -60
- package/dist/cli/lib/trace.d.ts.map +1 -1
- package/dist/cli/lib/trace.js +3 -304
- package/dist/cli/lib/trace.js.map +1 -1
- package/dist/cli/lib/upgrade-plan-catalog.d.ts +13 -0
- package/dist/cli/lib/upgrade-plan-catalog.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-plan-catalog.js +85 -0
- package/dist/cli/lib/upgrade-plan-catalog.js.map +1 -0
- package/dist/cli/lib/upgrade-plan-payload.d.ts +1 -1
- package/dist/cli/lib/upgrade-plan-payload.d.ts.map +1 -1
- package/dist/cli/lib/upgrade-plan-scaffold.d.ts +15 -0
- package/dist/cli/lib/upgrade-plan-scaffold.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-plan-scaffold.js +109 -0
- package/dist/cli/lib/upgrade-plan-scaffold.js.map +1 -0
- package/dist/cli/lib/upgrade-plan-types.d.ts +43 -0
- package/dist/cli/lib/upgrade-plan-types.d.ts.map +1 -0
- package/dist/cli/lib/upgrade-plan-types.js +3 -0
- package/dist/cli/lib/upgrade-plan-types.js.map +1 -0
- package/dist/cli/lib/upgrade-plan.d.ts +4 -62
- package/dist/cli/lib/upgrade-plan.d.ts.map +1 -1
- package/dist/cli/lib/upgrade-plan.js +7 -181
- package/dist/cli/lib/upgrade-plan.js.map +1 -1
- package/dist/cli/lib/verification-plan.d.ts +22 -0
- package/dist/cli/lib/verification-plan.d.ts.map +1 -0
- package/dist/cli/lib/verification-plan.js +26 -0
- package/dist/cli/lib/verification-plan.js.map +1 -0
- package/dist/cli/lib/verify-defensive-phase.d.ts +1 -1
- package/dist/cli/lib/verify-defensive-phase.d.ts.map +1 -1
- package/dist/cli/lib/verify-engine.d.ts +2 -36
- package/dist/cli/lib/verify-engine.d.ts.map +1 -1
- package/dist/cli/lib/verify-engine.js.map +1 -1
- package/dist/cli/lib/verify-export.d.ts.map +1 -1
- package/dist/cli/lib/verify-export.js +30 -19
- package/dist/cli/lib/verify-export.js.map +1 -1
- package/dist/cli/lib/verify-failure-normalize.d.ts +2 -3
- package/dist/cli/lib/verify-failure-normalize.d.ts.map +1 -1
- package/dist/cli/lib/verify-failure-normalize.js +0 -14
- package/dist/cli/lib/verify-failure-normalize.js.map +1 -1
- package/dist/cli/lib/verify-finding.d.ts +16 -0
- package/dist/cli/lib/verify-finding.d.ts.map +1 -0
- package/dist/cli/lib/verify-finding.js +11 -0
- package/dist/cli/lib/verify-finding.js.map +1 -0
- package/dist/cli/lib/verify-hints.d.ts +1 -1
- package/dist/cli/lib/verify-hints.d.ts.map +1 -1
- package/dist/cli/lib/verify-options.d.ts +40 -0
- package/dist/cli/lib/verify-options.d.ts.map +1 -0
- package/dist/cli/lib/verify-options.js +13 -0
- package/dist/cli/lib/verify-options.js.map +1 -0
- package/dist/cli/lib/verify-payload.d.ts +10 -1
- package/dist/cli/lib/verify-payload.d.ts.map +1 -1
- package/dist/cli/lib/verify-payload.js +52 -2
- package/dist/cli/lib/verify-payload.js.map +1 -1
- package/dist/cli/lib/verify-presenters.d.ts +2 -1
- package/dist/cli/lib/verify-presenters.d.ts.map +1 -1
- package/dist/cli/lib/verify-presenters.js.map +1 -1
- package/dist/cli/lib/verify-run.d.ts +2 -2
- package/dist/cli/lib/verify-run.d.ts.map +1 -1
- package/dist/cli/lib/verify-run.js +33 -19
- package/dist/cli/lib/verify-run.js.map +1 -1
- package/dist/cli/lib/version.gen.d.ts +1 -1
- package/dist/cli/lib/version.gen.js +1 -1
- package/dist/cli/program-arch.js +1 -1
- package/dist/cli/program-arch.js.map +1 -1
- package/dist/cli/program-blueprint.d.ts +3 -0
- package/dist/cli/program-blueprint.d.ts.map +1 -0
- package/dist/cli/program-blueprint.js +12 -0
- package/dist/cli/program-blueprint.js.map +1 -0
- package/dist/cli/program-core.d.ts.map +1 -1
- package/dist/cli/program-core.js +4 -20
- package/dist/cli/program-core.js.map +1 -1
- package/dist/cli/program-init-options.d.ts +4 -0
- package/dist/cli/program-init-options.d.ts.map +1 -0
- package/dist/cli/program-init-options.js +23 -0
- package/dist/cli/program-init-options.js.map +1 -0
- package/dist/cli/program-workflow.d.ts.map +1 -1
- package/dist/cli/program-workflow.js +19 -2
- package/dist/cli/program-workflow.js.map +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +4 -0
- package/dist/cli/program.js.map +1 -1
- package/package.json +2 -2
- package/templates/.gitagent/foreman/SUBSTRATE.version.json +1 -1
- package/templates/integrations/asset-catalog.json +3 -0
- package/templates/integrations/compatibility.json +1 -1
- package/templates/scripts/gxt-manifest-lib.mjs +12 -493
- package/templates/scripts/lib/glob-match.mjs +24 -0
- package/templates/scripts/lib/manifest-validate.mjs +126 -0
- package/templates/scripts/lib/trusted-automation.mjs +360 -0
- package/dist/cli/lib/architecture-credential.d.ts.map +0 -1
- package/dist/cli/lib/architecture-credential.js.map +0 -1
- package/dist/cli/lib/architecture-fetch.d.ts.map +0 -1
- package/dist/cli/lib/architecture-fetch.js.map +0 -1
- package/dist/cli/lib/architecture-pointer.d.ts.map +0 -1
- package/dist/cli/lib/architecture-pointer.js.map +0 -1
- package/dist/cli/lib/target-architecture-doctor.d.ts.map +0 -1
- package/dist/cli/lib/target-architecture-doctor.js.map +0 -1
- package/dist/cli/lib/target-architecture.d.ts.map +0 -1
- package/dist/cli/lib/target-architecture.js.map +0 -1
- /package/dist/cli/lib/{target-architecture-doctor.js → arch/cage/target-architecture-doctor.js} +0 -0
- /package/dist/cli/lib/{architecture-credential.d.ts → arch/external/architecture-credential.d.ts} +0 -0
- /package/dist/cli/lib/{architecture-fetch.d.ts → arch/external/architecture-fetch.d.ts} +0 -0
|
@@ -1,122 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
export interface DraftLegislationInput {
|
|
11
|
-
title: string;
|
|
12
|
-
msn_id: string;
|
|
13
|
-
skill_key: string;
|
|
14
|
-
gate_command: string;
|
|
15
|
-
gate_success_substring?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface DraftLegislationResult {
|
|
18
|
-
status: "awaiting_human_approval";
|
|
19
|
-
draft_token: string;
|
|
20
|
-
chat_message_to_user: string;
|
|
21
|
-
expires_at: string;
|
|
22
|
-
requires_planner_commit: true;
|
|
23
|
-
}
|
|
24
|
-
export interface ExecuteLegislationResult {
|
|
25
|
-
status: "pending_signature";
|
|
26
|
-
msn_id: string;
|
|
27
|
-
mission_file_path: string;
|
|
28
|
-
suggested_human_action: string;
|
|
29
|
-
commit_message: string;
|
|
30
|
-
commit_target: string;
|
|
31
|
-
requires_planner_commit: true;
|
|
32
|
-
next_tool: "gxt_check_signature";
|
|
33
|
-
}
|
|
34
|
-
export interface CheckSignatureResult {
|
|
35
|
-
status: "signature_valid" | "signature_missing";
|
|
36
|
-
msn_id: string;
|
|
37
|
-
mission_file_path: string;
|
|
38
|
-
message: string;
|
|
39
|
-
next_tools?: string[];
|
|
40
|
-
}
|
|
41
|
-
export type PinMissionResult = {
|
|
42
|
-
status: "pinned";
|
|
43
|
-
mission_file_path: string;
|
|
44
|
-
message: string;
|
|
45
|
-
} | {
|
|
46
|
-
status: "error";
|
|
47
|
-
error: McpErrorBody;
|
|
48
|
-
};
|
|
49
|
-
export type ResolveMissionResult = {
|
|
50
|
-
status: "resolved";
|
|
51
|
-
mission_file_path: string;
|
|
52
|
-
} | {
|
|
53
|
-
status: "unpinned";
|
|
54
|
-
mission_file_path: null;
|
|
55
|
-
message: string;
|
|
56
|
-
};
|
|
57
|
-
export type LastErrorResult = {
|
|
58
|
-
status: "empty";
|
|
59
|
-
message: string;
|
|
60
|
-
} | {
|
|
61
|
-
status: "found";
|
|
62
|
-
payload: AgentErrorPayload;
|
|
63
|
-
} | {
|
|
64
|
-
status: "error";
|
|
65
|
-
message: string;
|
|
66
|
-
};
|
|
67
|
-
export type StartOrchestrationMcpResult = {
|
|
68
|
-
status: "ok";
|
|
69
|
-
triage: TriageResult;
|
|
70
|
-
triage_action: string;
|
|
71
|
-
msn_id: string | null;
|
|
72
|
-
mission_file_path: string | null;
|
|
73
|
-
skill_key: string;
|
|
74
|
-
next_actions: string[];
|
|
75
|
-
exit_code: number;
|
|
76
|
-
pinned_mission?: string;
|
|
77
|
-
runtime_env?: RuntimeEnvMcpResult;
|
|
78
|
-
resolve: ResolveMissionResult;
|
|
79
|
-
} | {
|
|
80
|
-
status: "failed";
|
|
81
|
-
triage: TriageResult;
|
|
82
|
-
triage_action: string;
|
|
83
|
-
skill_key: string;
|
|
84
|
-
msn_id: string | null;
|
|
85
|
-
mission_file_path: string | null;
|
|
86
|
-
next_actions: string[];
|
|
87
|
-
exit_code: number;
|
|
88
|
-
};
|
|
89
|
-
export interface StartOrchestrationInput {
|
|
90
|
-
intent: string;
|
|
91
|
-
msn_id?: string;
|
|
92
|
-
skill_key?: string;
|
|
93
|
-
gate_command?: string;
|
|
94
|
-
gate_success_substring?: string;
|
|
95
|
-
pin_if_needed?: boolean;
|
|
96
|
-
emit_runtime_env?: boolean;
|
|
97
|
-
write_mission?: boolean;
|
|
98
|
-
}
|
|
99
|
-
export declare function mcpError(code: string, message: string, retryable: boolean): {
|
|
100
|
-
status: "error";
|
|
101
|
-
error: McpErrorBody;
|
|
102
|
-
};
|
|
103
|
-
export declare function handleDraftLegislation(input: DraftLegislationInput): DraftLegislationResult | {
|
|
104
|
-
status: "error";
|
|
105
|
-
error: McpErrorBody;
|
|
106
|
-
};
|
|
107
|
-
export declare function handleExecuteLegislation(draftToken: string): ExecuteLegislationResult | {
|
|
108
|
-
status: "error";
|
|
109
|
-
error: McpErrorBody;
|
|
110
|
-
};
|
|
111
|
-
export declare function handleCheckSignature(missionFilePath: string): CheckSignatureResult | {
|
|
112
|
-
status: "error";
|
|
113
|
-
error: McpErrorBody;
|
|
114
|
-
};
|
|
115
|
-
export declare function handlePinMission(missionFilePath: string): PinMissionResult | {
|
|
116
|
-
status: "error";
|
|
117
|
-
error: McpErrorBody;
|
|
118
|
-
};
|
|
119
|
-
export declare function handleResolveMission(explicit?: string): ResolveMissionResult;
|
|
120
|
-
export declare function handleLastError(): LastErrorResult;
|
|
121
|
-
export declare function handleStartOrchestration(input: StartOrchestrationInput): StartOrchestrationMcpResult;
|
|
1
|
+
export type { McpToolStatus, McpErrorBody, DraftLegislationInput, DraftLegislationResult, ExecuteLegislationResult, CheckSignatureResult, PinMissionResult, ResolveMissionResult, LastErrorResult, StartOrchestrationMcpResult, StartOrchestrationInput, } from "./mcp-governance-shared.js";
|
|
2
|
+
export { mcpError, mcpWriteDenied, resolveGuardedMissionAbs } from "./mcp-governance-shared.js";
|
|
3
|
+
export { handleDraftLegislation } from "./mcp-draft-legislation.js";
|
|
4
|
+
export { handleExecuteLegislation } from "./mcp-execute-legislation.js";
|
|
5
|
+
export { handleCheckSignature } from "./mcp-check-signature.js";
|
|
6
|
+
export { handlePinMission } from "./mcp-pin-mission.js";
|
|
7
|
+
export { handleResolveMission } from "./mcp-resolve-mission.js";
|
|
8
|
+
export { handleLastError } from "./mcp-last-error.js";
|
|
9
|
+
export { handleStartOrchestration } from "./mcp-start-orchestration.js";
|
|
122
10
|
//# sourceMappingURL=mcp-governance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-governance.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/mcp-governance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-governance.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/mcp-governance.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,260 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { pinMissionFile, resolveMissionFilePath } from "./missions/parser.js";
|
|
10
|
-
import { resolvePinnedMission } from "./missions/parser.js";
|
|
11
|
-
import { runStartOrchestration } from "./start-orchestration.js";
|
|
12
|
-
import { GantryUserError } from "./errors.js";
|
|
13
|
-
import { GXT_ERROR } from "./gxt-error-codes.js";
|
|
14
|
-
import { manifestHasSkill, resolveManifestSkillKey } from "./skill-key.js";
|
|
15
|
-
import { loadWorkspace } from "./workspace.js";
|
|
16
|
-
import { assertMcpMissionWritePath, McpWriteDeniedError } from "./mcp-write-guard.js";
|
|
17
|
-
export function mcpError(code, message, retryable) {
|
|
18
|
-
return { status: "error", error: { code, message, retryable } };
|
|
19
|
-
}
|
|
20
|
-
function mcpWriteDenied(err) {
|
|
21
|
-
return mcpError(GXT_ERROR.MCP_WRITE_DENIED, err.message, false);
|
|
22
|
-
}
|
|
23
|
-
function resolveGuardedMissionAbs(root, missionFilePath) {
|
|
24
|
-
try {
|
|
25
|
-
assertMcpMissionWritePath(missionFilePath);
|
|
26
|
-
}
|
|
27
|
-
catch (err) {
|
|
28
|
-
if (err instanceof McpWriteDeniedError)
|
|
29
|
-
return { kind: "denied", error: mcpWriteDenied(err) };
|
|
30
|
-
throw err;
|
|
31
|
-
}
|
|
32
|
-
return { kind: "resolved", missionAbs: resolveMissionFilePath(root, missionFilePath) };
|
|
33
|
-
}
|
|
34
|
-
function buildDraftChatMessage(input, manifestSkillDesc) {
|
|
35
|
-
const lines = [
|
|
36
|
-
"## Proposed GXT mission (draft — not yet written)",
|
|
37
|
-
"",
|
|
38
|
-
`- **Title:** ${input.title}`,
|
|
39
|
-
`- **MSN:** ${input.msn_id}`,
|
|
40
|
-
`- **Skill:** ${input.skill_key}`,
|
|
41
|
-
`- **Gate:** \`${input.gate_command}\``,
|
|
42
|
-
];
|
|
43
|
-
if (input.gate_success_substring?.trim()) {
|
|
44
|
-
lines.push(`- **Gate success substring:** \`${input.gate_success_substring.trim()}\``);
|
|
45
|
-
}
|
|
46
|
-
if (manifestSkillDesc) {
|
|
47
|
-
lines.push(`- **Skill scope:** ${manifestSkillDesc}`);
|
|
48
|
-
}
|
|
49
|
-
lines.push("", "Reply with clear approval (e.g. **yes**, **approve**, **looks good**) to execute legislation, or **deny** / **no** to cancel.", "", "_No mission file will be written until you approve._");
|
|
50
|
-
return lines.join("\n");
|
|
51
|
-
}
|
|
52
|
-
function validateDraftInput(input) {
|
|
53
|
-
if (!input.title?.trim()) {
|
|
54
|
-
return { code: "VALIDATION_ERROR", message: "title is required", retryable: true };
|
|
55
|
-
}
|
|
56
|
-
if (!MSN_ID_PATTERN.test(input.msn_id?.trim() ?? "")) {
|
|
57
|
-
return { code: "VALIDATION_ERROR", message: 'msn_id must match "MSN-0007"', retryable: true };
|
|
58
|
-
}
|
|
59
|
-
if (!input.skill_key?.trim()) {
|
|
60
|
-
return { code: "VALIDATION_ERROR", message: "skill_key is required", retryable: true };
|
|
61
|
-
}
|
|
62
|
-
if (!input.gate_command?.trim()) {
|
|
63
|
-
return { code: "VALIDATION_ERROR", message: "gate_command is required", retryable: true };
|
|
64
|
-
}
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
export function handleDraftLegislation(input) {
|
|
68
|
-
const validation = validateDraftInput(input);
|
|
69
|
-
if (validation)
|
|
70
|
-
return mcpError(validation.code, validation.message, validation.retryable);
|
|
71
|
-
const { root, manifest } = loadWorkspace();
|
|
72
|
-
const skillKey = input.skill_key.trim();
|
|
73
|
-
if (!manifestHasSkill(manifest, skillKey)) {
|
|
74
|
-
return mcpError("UNKNOWN_SKILL", `unknown skill_key "${skillKey}" (manifest skills: ${Object.keys(manifest.skills).join(", ")})`, true);
|
|
75
|
-
}
|
|
76
|
-
const token = createDraftToken(root, {
|
|
77
|
-
title: input.title,
|
|
78
|
-
msn_id: input.msn_id.trim(),
|
|
79
|
-
skill_key: skillKey,
|
|
80
|
-
gate_command: input.gate_command,
|
|
81
|
-
gate_success_substring: input.gate_success_substring,
|
|
82
|
-
});
|
|
83
|
-
return {
|
|
84
|
-
status: "awaiting_human_approval",
|
|
85
|
-
draft_token: token.draft_token,
|
|
86
|
-
chat_message_to_user: buildDraftChatMessage(input, manifest.skills[resolveManifestSkillKey(manifest, skillKey)]?.desc),
|
|
87
|
-
expires_at: token.expires_at,
|
|
88
|
-
requires_planner_commit: true,
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
export function handleExecuteLegislation(draftToken) {
|
|
92
|
-
const { root } = loadWorkspace();
|
|
93
|
-
let payload;
|
|
94
|
-
try {
|
|
95
|
-
payload = verifyDraftToken(root, draftToken, { consume: true });
|
|
96
|
-
}
|
|
97
|
-
catch (err) {
|
|
98
|
-
if (err instanceof DraftTokenError) {
|
|
99
|
-
return mcpError(err.code, err.message, err.retryable);
|
|
100
|
-
}
|
|
101
|
-
throw err;
|
|
102
|
-
}
|
|
103
|
-
const legislateOpts = {
|
|
104
|
-
intent: payload.title,
|
|
105
|
-
msn: payload.msn_id,
|
|
106
|
-
skillKey: payload.skill_key,
|
|
107
|
-
gateCommand: payload.gate_command,
|
|
108
|
-
gateSuccessSubstring: payload.gate_success_substring,
|
|
109
|
-
};
|
|
110
|
-
const result = runLegislate(legislateOpts);
|
|
111
|
-
if (!result.ok) {
|
|
112
|
-
return mcpError("LEGISLATE_FAILED", "gantry legislate failed; check skill_key, msn, or output path", true);
|
|
113
|
-
}
|
|
114
|
-
const missionRel = formatRepoRelative(root, result.missionAbs);
|
|
115
|
-
try {
|
|
116
|
-
assertMcpMissionWritePath(missionRel);
|
|
117
|
-
}
|
|
118
|
-
catch (err) {
|
|
119
|
-
if (err instanceof McpWriteDeniedError)
|
|
120
|
-
return mcpWriteDenied(err);
|
|
121
|
-
throw err;
|
|
122
|
-
}
|
|
123
|
-
const escapedTitle = payload.title.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
124
|
-
const commitMessage = `[${payload.msn_id}] Legislate ${escapedTitle}`;
|
|
125
|
-
const suggestedHumanAction = `git add ${missionRel} && git commit -m "${commitMessage}"`;
|
|
126
|
-
return {
|
|
127
|
-
status: "pending_signature",
|
|
128
|
-
msn_id: payload.msn_id,
|
|
129
|
-
mission_file_path: missionRel,
|
|
130
|
-
suggested_human_action: suggestedHumanAction,
|
|
131
|
-
commit_message: commitMessage,
|
|
132
|
-
commit_target: missionRel,
|
|
133
|
-
requires_planner_commit: true,
|
|
134
|
-
next_tool: "gxt_check_signature",
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
export function handleCheckSignature(missionFilePath) {
|
|
138
|
-
const { root } = loadWorkspace();
|
|
139
|
-
const resolution = resolveGuardedMissionAbs(root, missionFilePath);
|
|
140
|
-
if (resolution.kind === "denied")
|
|
141
|
-
return resolution.error;
|
|
142
|
-
const missionAbs = resolution.missionAbs;
|
|
143
|
-
if (!fs.existsSync(missionAbs)) {
|
|
144
|
-
return mcpError("MISSION_NOT_FOUND", `mission file not found: ${missionFilePath}`, true);
|
|
145
|
-
}
|
|
146
|
-
try {
|
|
147
|
-
const msnId = assertPlannerMissionProof(root, missionAbs);
|
|
148
|
-
const rel = formatRepoRelative(root, missionAbs);
|
|
149
|
-
return {
|
|
150
|
-
status: "signature_valid",
|
|
151
|
-
msn_id: msnId,
|
|
152
|
-
mission_file_path: rel,
|
|
153
|
-
message: `Planner signature valid for ${msnId}. You may pin the mission and begin executor execution.`,
|
|
154
|
-
next_tools: ["gxt_pin_mission", "gxt_runtime_env"],
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
catch (err) {
|
|
158
|
-
if (err instanceof GantryUserError) {
|
|
159
|
-
return {
|
|
160
|
-
status: "signature_missing",
|
|
161
|
-
msn_id: "unknown",
|
|
162
|
-
mission_file_path: formatRepoRelative(root, missionAbs),
|
|
163
|
-
message: err.message,
|
|
164
|
-
next_tools: [],
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
throw err;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
export function handlePinMission(missionFilePath) {
|
|
171
|
-
const { root } = loadWorkspace();
|
|
172
|
-
const resolution = resolveGuardedMissionAbs(root, missionFilePath);
|
|
173
|
-
if (resolution.kind === "denied")
|
|
174
|
-
return resolution.error;
|
|
175
|
-
const missionAbs = resolution.missionAbs;
|
|
176
|
-
if (!fs.existsSync(missionAbs)) {
|
|
177
|
-
return mcpError("MISSION_NOT_FOUND", `mission file not found: ${missionFilePath}`, true);
|
|
178
|
-
}
|
|
179
|
-
const rel = pinMissionFile(root, missionAbs);
|
|
180
|
-
return {
|
|
181
|
-
status: "pinned",
|
|
182
|
-
mission_file_path: rel,
|
|
183
|
-
message: `Pinned active mission: ${rel}`,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
export function handleResolveMission(explicit) {
|
|
187
|
-
const { root } = loadWorkspace();
|
|
188
|
-
const resolved = resolvePinnedMission(root, {
|
|
189
|
-
explicit,
|
|
190
|
-
profile: "full",
|
|
191
|
-
});
|
|
192
|
-
if (resolved) {
|
|
193
|
-
return { status: "resolved", mission_file_path: resolved };
|
|
194
|
-
}
|
|
195
|
-
return {
|
|
196
|
-
status: "unpinned",
|
|
197
|
-
mission_file_path: null,
|
|
198
|
-
message: "No active mission pinned. Run Mission Architect / gxt_draft_legislation first.",
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
export function handleLastError() {
|
|
202
|
-
const { root } = loadWorkspace();
|
|
203
|
-
const errPath = path.join(root, ".gitagent", "history", ".ignored-last-error.json");
|
|
204
|
-
if (!fs.existsSync(errPath)) {
|
|
205
|
-
return { status: "empty", message: "No last error recorded." };
|
|
206
|
-
}
|
|
207
|
-
try {
|
|
208
|
-
const payload = JSON.parse(fs.readFileSync(errPath, "utf8"));
|
|
209
|
-
return { status: "found", payload };
|
|
210
|
-
}
|
|
211
|
-
catch {
|
|
212
|
-
return { status: "error", message: "Failed to parse last error file." };
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
export function handleStartOrchestration(input) {
|
|
216
|
-
const result = runStartOrchestration({
|
|
217
|
-
intent: input.intent,
|
|
218
|
-
msn: input.msn_id,
|
|
219
|
-
skillKey: input.skill_key,
|
|
220
|
-
gateCommand: input.gate_command,
|
|
221
|
-
gateSuccessSubstring: input.gate_success_substring,
|
|
222
|
-
writeMission: input.write_mission !== false,
|
|
223
|
-
silent: true,
|
|
224
|
-
});
|
|
225
|
-
if (!result.ok) {
|
|
226
|
-
return {
|
|
227
|
-
status: "failed",
|
|
228
|
-
triage: result.triage,
|
|
229
|
-
triage_action: result.triage_action,
|
|
230
|
-
skill_key: result.skill_key,
|
|
231
|
-
msn_id: result.msn_id,
|
|
232
|
-
mission_file_path: result.mission_file_path,
|
|
233
|
-
next_actions: result.next_steps,
|
|
234
|
-
exit_code: result.exit_code,
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
const payload = {
|
|
238
|
-
status: "ok",
|
|
239
|
-
triage: result.triage,
|
|
240
|
-
triage_action: result.triage_action,
|
|
241
|
-
msn_id: result.msn_id,
|
|
242
|
-
mission_file_path: result.mission_file_path,
|
|
243
|
-
skill_key: result.skill_key,
|
|
244
|
-
next_actions: result.next_steps,
|
|
245
|
-
exit_code: result.exit_code,
|
|
246
|
-
resolve: handleResolveMission(result.mission_file_path ?? undefined),
|
|
247
|
-
};
|
|
248
|
-
if (input.pin_if_needed === true && result.mission_file_path) {
|
|
249
|
-
const { root } = loadWorkspace();
|
|
250
|
-
const resolution = resolveGuardedMissionAbs(root, result.mission_file_path);
|
|
251
|
-
if (resolution.kind === "resolved" && fs.existsSync(resolution.missionAbs)) {
|
|
252
|
-
payload.pinned_mission = pinMissionFile(root, resolution.missionAbs);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
if (input.emit_runtime_env === true && result.mission_file_path) {
|
|
256
|
-
payload.runtime_env = handleRuntimeEnv(result.mission_file_path);
|
|
257
|
-
}
|
|
258
|
-
return payload;
|
|
259
|
-
}
|
|
1
|
+
export { mcpError, mcpWriteDenied, resolveGuardedMissionAbs } from "./mcp-governance-shared.js";
|
|
2
|
+
export { handleDraftLegislation } from "./mcp-draft-legislation.js";
|
|
3
|
+
export { handleExecuteLegislation } from "./mcp-execute-legislation.js";
|
|
4
|
+
export { handleCheckSignature } from "./mcp-check-signature.js";
|
|
5
|
+
export { handlePinMission } from "./mcp-pin-mission.js";
|
|
6
|
+
export { handleResolveMission } from "./mcp-resolve-mission.js";
|
|
7
|
+
export { handleLastError } from "./mcp-last-error.js";
|
|
8
|
+
export { handleStartOrchestration } from "./mcp-start-orchestration.js";
|
|
260
9
|
//# sourceMappingURL=mcp-governance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-governance.js","sourceRoot":"","sources":["../../../src/cli/lib/mcp-governance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcp-governance.js","sourceRoot":"","sources":["../../../src/cli/lib/mcp-governance.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-last-error.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/mcp-last-error.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlE,wBAAgB,eAAe,IAAI,eAAe,CAYjD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { loadWorkspace } from "./workspace.js";
|
|
4
|
+
export function handleLastError() {
|
|
5
|
+
const { root } = loadWorkspace();
|
|
6
|
+
const errPath = path.join(root, ".gitagent", "history", ".ignored-last-error.json");
|
|
7
|
+
if (!fs.existsSync(errPath)) {
|
|
8
|
+
return { status: "empty", message: "No last error recorded." };
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
const payload = JSON.parse(fs.readFileSync(errPath, "utf8"));
|
|
12
|
+
return { status: "found", payload };
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return { status: "error", message: "Failed to parse last error file." };
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=mcp-last-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-last-error.js","sourceRoot":"","sources":["../../../src/cli/lib/mcp-last-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,UAAU,eAAe;IAC7B,MAAM,EAAE,IAAI,EAAE,GAAG,aAAa,EAAE,CAAC;IACjC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,0BAA0B,CAAC,CAAC;IACpF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,CAAC;IACjE,CAAC;IACD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAsB,CAAC;QAClF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,kCAAkC,EAAE,CAAC;IAC1E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type McpErrorBody, type PinMissionResult } from "./mcp-governance-shared.js";
|
|
2
|
+
export declare function handlePinMission(missionFilePath: string): PinMissionResult | {
|
|
3
|
+
status: "error";
|
|
4
|
+
error: McpErrorBody;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=mcp-pin-mission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-pin-mission.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/mcp-pin-mission.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACtB,MAAM,4BAA4B,CAAC;AAIpC,wBAAgB,gBAAgB,CAAC,eAAe,EAAE,MAAM,GAAG,gBAAgB,GAAG;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,CAgBrH"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { mcpError, resolveGuardedMissionAbs, } from "./mcp-governance-shared.js";
|
|
3
|
+
import { pinMissionFile } from "./missions/parser.js";
|
|
4
|
+
import { loadWorkspace } from "./workspace.js";
|
|
5
|
+
export function handlePinMission(missionFilePath) {
|
|
6
|
+
const { root } = loadWorkspace();
|
|
7
|
+
const resolution = resolveGuardedMissionAbs(root, missionFilePath);
|
|
8
|
+
if (resolution.kind === "denied")
|
|
9
|
+
return resolution.error;
|
|
10
|
+
const missionAbs = resolution.missionAbs;
|
|
11
|
+
if (!fs.existsSync(missionAbs)) {
|
|
12
|
+
return mcpError("MISSION_NOT_FOUND", `mission file not found: ${missionFilePath}`, true);
|
|
13
|
+
}
|
|
14
|
+
const rel = pinMissionFile(root, missionAbs);
|
|
15
|
+
return {
|
|
16
|
+
status: "pinned",
|
|
17
|
+
mission_file_path: rel,
|
|
18
|
+
message: `Pinned active mission: ${rel}`,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=mcp-pin-mission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-pin-mission.js","sourceRoot":"","sources":["../../../src/cli/lib/mcp-pin-mission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EACL,QAAQ,EACR,wBAAwB,GAGzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,UAAU,gBAAgB,CAAC,eAAuB;IACtD,MAAM,EAAE,IAAI,EAAE,GAAG,aAAa,EAAE,CAAC;IACjC,MAAM,UAAU,GAAG,wBAAwB,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IACnE,IAAI,UAAU,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,UAAU,CAAC,KAAK,CAAC;IAC1D,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;IAEzC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC/B,OAAO,QAAQ,CAAC,mBAAmB,EAAE,2BAA2B,eAAe,EAAE,EAAE,IAAI,CAAC,CAAC;IAC3F,CAAC;IAED,MAAM,GAAG,GAAG,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC7C,OAAO;QACL,MAAM,EAAE,QAAQ;QAChB,iBAAiB,EAAE,GAAG;QACtB,OAAO,EAAE,0BAA0B,GAAG,EAAE;KACzC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-resolve-mission.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/mcp-resolve-mission.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGvE,wBAAgB,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,oBAAoB,CAgB5E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { resolvePinnedMission } from "./missions/parser.js";
|
|
2
|
+
import { loadWorkspace } from "./workspace.js";
|
|
3
|
+
export function handleResolveMission(explicit) {
|
|
4
|
+
const { root } = loadWorkspace();
|
|
5
|
+
const resolved = resolvePinnedMission(root, {
|
|
6
|
+
explicit,
|
|
7
|
+
profile: "full",
|
|
8
|
+
});
|
|
9
|
+
if (resolved) {
|
|
10
|
+
return { status: "resolved", mission_file_path: resolved };
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
status: "unpinned",
|
|
14
|
+
mission_file_path: null,
|
|
15
|
+
message: "No active mission pinned. Run Mission Architect / gxt_draft_legislation first.",
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=mcp-resolve-mission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-resolve-mission.js","sourceRoot":"","sources":["../../../src/cli/lib/mcp-resolve-mission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,UAAU,oBAAoB,CAAC,QAAiB;IACpD,MAAM,EAAE,IAAI,EAAE,GAAG,aAAa,EAAE,CAAC;IACjC,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,EAAE;QAC1C,QAAQ;QACR,OAAO,EAAE,MAAM;KAChB,CAAC,CAAC;IAEH,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,QAAQ,EAAE,CAAC;IAC7D,CAAC;IAED,OAAO;QACL,MAAM,EAAE,UAAU;QAClB,iBAAiB,EAAE,IAAI;QACvB,OAAO,EAAE,gFAAgF;KAC1F,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type StartOrchestrationInput, type StartOrchestrationMcpResult } from "./mcp-governance-shared.js";
|
|
2
|
+
export declare function handleStartOrchestration(input: StartOrchestrationInput): StartOrchestrationMcpResult;
|
|
3
|
+
//# sourceMappingURL=mcp-start-orchestration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-start-orchestration.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/mcp-start-orchestration.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EACjC,MAAM,4BAA4B,CAAC;AAMpC,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,uBAAuB,GAAG,2BAA2B,CAiDpG"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { handleRuntimeEnv } from "./mcp-runtime.js";
|
|
3
|
+
import { resolveGuardedMissionAbs, } from "./mcp-governance-shared.js";
|
|
4
|
+
import { handleResolveMission } from "./mcp-resolve-mission.js";
|
|
5
|
+
import { pinMissionFile } from "./missions/parser.js";
|
|
6
|
+
import { runStartOrchestration } from "./start-orchestration.js";
|
|
7
|
+
import { loadWorkspace } from "./workspace.js";
|
|
8
|
+
export function handleStartOrchestration(input) {
|
|
9
|
+
const result = runStartOrchestration({
|
|
10
|
+
intent: input.intent,
|
|
11
|
+
msn: input.msn_id,
|
|
12
|
+
skillKey: input.skill_key,
|
|
13
|
+
gateCommand: input.gate_command,
|
|
14
|
+
gateSuccessSubstring: input.gate_success_substring,
|
|
15
|
+
writeMission: input.write_mission !== false,
|
|
16
|
+
silent: true,
|
|
17
|
+
});
|
|
18
|
+
if (!result.ok) {
|
|
19
|
+
return {
|
|
20
|
+
status: "failed",
|
|
21
|
+
triage: result.triage,
|
|
22
|
+
triage_action: result.triage_action,
|
|
23
|
+
skill_key: result.skill_key,
|
|
24
|
+
msn_id: result.msn_id,
|
|
25
|
+
mission_file_path: result.mission_file_path,
|
|
26
|
+
next_actions: result.next_steps,
|
|
27
|
+
exit_code: result.exit_code,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const payload = {
|
|
31
|
+
status: "ok",
|
|
32
|
+
triage: result.triage,
|
|
33
|
+
triage_action: result.triage_action,
|
|
34
|
+
msn_id: result.msn_id,
|
|
35
|
+
mission_file_path: result.mission_file_path,
|
|
36
|
+
skill_key: result.skill_key,
|
|
37
|
+
next_actions: result.next_steps,
|
|
38
|
+
exit_code: result.exit_code,
|
|
39
|
+
resolve: handleResolveMission(result.mission_file_path ?? undefined),
|
|
40
|
+
};
|
|
41
|
+
if (input.pin_if_needed === true && result.mission_file_path) {
|
|
42
|
+
const { root } = loadWorkspace();
|
|
43
|
+
const resolution = resolveGuardedMissionAbs(root, result.mission_file_path);
|
|
44
|
+
if (resolution.kind === "resolved" && fs.existsSync(resolution.missionAbs)) {
|
|
45
|
+
payload.pinned_mission = pinMissionFile(root, resolution.missionAbs);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (input.emit_runtime_env === true && result.mission_file_path) {
|
|
49
|
+
payload.runtime_env = handleRuntimeEnv(result.mission_file_path);
|
|
50
|
+
}
|
|
51
|
+
return payload;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=mcp-start-orchestration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-start-orchestration.js","sourceRoot":"","sources":["../../../src/cli/lib/mcp-start-orchestration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EACL,wBAAwB,GAGzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,UAAU,wBAAwB,CAAC,KAA8B;IACrE,MAAM,MAAM,GAAG,qBAAqB,CAAC;QACnC,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,GAAG,EAAE,KAAK,CAAC,MAAM;QACjB,QAAQ,EAAE,KAAK,CAAC,SAAS;QACzB,WAAW,EAAE,KAAK,CAAC,YAAY;QAC/B,oBAAoB,EAAE,KAAK,CAAC,sBAAsB;QAClD,YAAY,EAAE,KAAK,CAAC,aAAa,KAAK,KAAK;QAC3C,MAAM,EAAE,IAAI;KACb,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO;YACL,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;YAC3C,YAAY,EAAE,MAAM,CAAC,UAAU;YAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;SAC5B,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAgC;QAC3C,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;QAC3C,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,YAAY,EAAE,MAAM,CAAC,UAAU;QAC/B,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC,iBAAiB,IAAI,SAAS,CAAC;KACrE,CAAC;IAEF,IAAI,KAAK,CAAC,aAAa,KAAK,IAAI,IAAI,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAC7D,MAAM,EAAE,IAAI,EAAE,GAAG,aAAa,EAAE,CAAC;QACjC,MAAM,UAAU,GAAG,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAC5E,IAAI,UAAU,CAAC,IAAI,KAAK,UAAU,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3E,OAAO,CAAC,cAAc,GAAG,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;IAED,IAAI,KAAK,CAAC,gBAAgB,KAAK,IAAI,IAAI,MAAM,CAAC,iBAAiB,EAAE,CAAC;QAChE,OAAO,CAAC,WAAW,GAAG,gBAAgB,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-tools-register.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/mcp-tools-register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp-tools-register.d.ts","sourceRoot":"","sources":["../../../src/cli/lib/mcp-tools-register.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAsKzE,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAI3D"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { handleCheckSignature
|
|
2
|
+
import { handleCheckSignature } from "./mcp-check-signature.js";
|
|
3
|
+
import { handleDraftLegislation } from "./mcp-draft-legislation.js";
|
|
4
|
+
import { handleExecuteLegislation } from "./mcp-execute-legislation.js";
|
|
5
|
+
import { handleLastError } from "./mcp-last-error.js";
|
|
6
|
+
import { handlePinMission } from "./mcp-pin-mission.js";
|
|
7
|
+
import { handleResolveMission } from "./mcp-resolve-mission.js";
|
|
8
|
+
import { handleStartOrchestration } from "./mcp-start-orchestration.js";
|
|
3
9
|
import { handleRuntimeEnv, handleRuntimeExec, handleScan, handleVerify } from "./mcp-runtime.js";
|
|
4
10
|
import { handleUpgradeApply, handleUpgradePlan } from "./mcp-upgrade.js";
|
|
5
11
|
function jsonText(payload) {
|